Program that finds a different number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

5th Apr 2019, 8:19 AM
Наталья Морская Пехота
Наталья Морская Пехота - avatar
1 Answer
+ 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
5th Apr 2019, 5:39 PM
KanpekiAlice
KanpekiAlice - avatar