0
Program that finds a different number
Please write a program that will read the entered numbers (for example, 1 1 2 1), then find the one that is different and display its sequence number (in the previous sequence the different number is the third in the sequence) Language- JavaScript
1 Respuesta
+ 1
hello,
i think you need to specify more details about "the different one"
is there always just one odd number among the entered ones?
and if not, how would you define the non-odd ones
(in case we got 1 1 2 2 for example, or 1 2 2 3 3)
in case there are only 2 possible Numbers in our collection, this little function gets you the least found number
https://code.sololearn.com/Wl1IrOWYIcEE/#js