There is an array with some numbers. All numbers are equal except for one. Try to find it!
Kata.findUniq(new double[]{ 1, 1, 1, 2, 1, 1 }); // => 2
Kata.findUniq(new double[]{ 0, 0, 0.55, 0, 0 }); // => 0.55
It’s guaranteed that array contains more than 3 numbers.
The tests contain some very huge arrays, so think about performance.
'매일매일개발 > Codewars' 카테고리의 다른 글
Codewars #6 Calculate String Rotation (6kuy) (0) | 2018.03.24 |
---|---|
Codewars #5 Take a Number And Sum Its Digits Raised To The Consecutive Powers And ....¡Eureka!! (6kuy) (0) | 2018.03.23 |
Codwars #3 Sort the odd (6kyu) (0) | 2018.03.21 |
Codwars #2 Sum of the first nth term of Series (7kyu) (0) | 2018.03.20 |
Codwars #1 Find the missing letter (6kyu) (0) | 2018.03.20 |