+ 1
Given an array of integers, find the numbers that appears an odd number of times return an array of the numbers.
input: [1,1,1,2,2,3,3,3,2] output: [1,2,3]
10 odpowiedzi
0
Post your attempt first..
0
notGreat
Pls tag the language also..
May you looking like this :
for(i in obj){
if(obj[i].length % 2 !== 0 && obj[i].length != 1) num.push(+i);
}
0
Jayakrishna🇮🇳
I don't completely know what your asking, but if that code is part of your solution to the asked problem then it's incorrect, you don't want to filter values with length not equal 1 you would want the first condition obj[I].length % 2 != 0 as 1 is an odd number, you can see that I had that idea on line 10 of my odd int problem
0
Maria Vasilyova the problem is to determine if there is a number(s) in an array that appears an odd number of time
you can view my solution on comment
0
Jayakrishna🇮🇳 I completed the challenge in JavaScript but you can complete in whatever language you please
0
notGreat
That is a about, dublicate numbers printing.. Can you give an example which is you not getting write? With expected output?