+ 1
How to find missing numbers in array?
Need some logics to find this
7 ответов
+ 1
One solution could be to have two arrays and loop over the expected numbers.
a = [1,2,3,4,5]
b = [1,2,5]
missing = []
foreach number in a {
if number not in array b {
add to missing array;
}
}
console.log(missing);
This is not full javascript but I hope it helps :)
+ 1
Thank you so much
0
Could you give us more informations? The tags are a good place to write the language you use!
Link us your attemps fron the code playgtound so we can help you out.
Do you have example input and expected output?
0
I have mentioned language please check
0
nice, do you have more information? what do you mean by finding missing numbers? do you have an example?
0
Like suppose that arr [101, 102, 103 , 108, 110] find missing number between 101 to 110 in JavaScript?
- 1
叔叔就睡觉