0% found this document useful (0 votes)
2K views

Maximum of Unstable-Minimum of Unstable

The detective Buckshee Junior has been asked to help a children's society find the password to access a games complex. The password is generated based on 5 numbers provided, finding the maximum of all unstable numbers plus the minimum of all unstable numbers. The document provides definitions and examples of stable and unstable numbers. It requests help writing a function to generate the password given 5 input numbers.

Uploaded by

kummetha vanitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Maximum of Unstable-Minimum of Unstable

The detective Buckshee Junior has been asked to help a children's society find the password to access a games complex. The password is generated based on 5 numbers provided, finding the maximum of all unstable numbers plus the minimum of all unstable numbers. The document provides definitions and examples of stable and unstable numbers. It requests help writing a function to generate the password given 5 input numbers.

Uploaded by

kummetha vanitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Find Password:

Detective Buckshee Junior has been approached by the shantiniketankids


society for help in finding the password to the games complex. After hearing the
scenario, detective Buckshee Junior realises that he will need a programmers
support He contacts youand requests your help. Please help the detective by
writing a function to generate the password.

The scenariois as below-


Five numbers are available with the kids.
These numbers are eitherstable or unstable.
A number is stable if each of its digit occur the same number of times, i.e. the
frequency of each digit in the numberis the same. For e.g. 2277, 4004, 11, 20
583835, 1010 are examples of stable numbers..
Similarly, A number is unstable if the frequency of each digit in the number is
NOT the same. For e.g. 221, 4314, 101, 233, 58135 101 are examples ot
unstable numbers

The password can be found as below -


i.e. password = Maximum of all Unstable numbers + Minimum of all
Unstable numbers

are passed to a function as inputl , input2,


Assuming that the five' nunnbers•
input3, input4 and input5, cpnnpietethe function.to find and return the password
// Write code here..
int
L in kedLi st <Intege
for(int i:arr) ;

else
add(i);}

Collectionsßorte&rl);
vol
return 0;
size C)
retu8n get(åjs
return Egef(eye
•oolean
28 arll=new int[le]', äx=0;
29 while
30
31
32 num/=10;
33
34 for(int i:ar)
35
36 if(i
37
38
39 {max=i; }
40
41 t' return false; h)
42
43
44 return true;

46
Compile & Test
Code Result> •UlYbgFTI?tcase

You might also like