6 kyu
Find the unique number
52,694 of 149,652isqua
Description:
There is an array with some numbers. All numbers are equal except for one. Try to find it!
findUniq([ 1, 1, 1, 2, 1, 1 ]) === 2
findUniq([ 0, 0, 0.55, 0, 0 ]) === 0.55
It’s guaranteed that array contains at least 3 numbers.
The tests contain some very huge arrays, so think about performance.
This is the first kata in series:
- Find the unique number (this kata)
- Find the unique string
- Find The Unique
Fundamentals
Algorithms
Arrays
Performance
Similar Kata:
Stats:
Created | Dec 23, 2016 |
Published | Dec 23, 2016 |
Warriors Trained | 234830 |
Total Skips | 27688 |
Total Code Submissions | 672570 |
Total Times Completed | 149652 |
JavaScript Completions | 52694 |
PHP Completions | 3279 |
Python Completions | 56664 |
Java Completions | 16359 |
TypeScript Completions | 3359 |
Go Completions | 3070 |
C# Completions | 7702 |
Haskell Completions | 1008 |
Ruby Completions | 2875 |
F# Completions | 73 |
Swift Completions | 796 |
COBOL Completions | 17 |
D Completions | 10 |
C Completions | 1252 |
NASM Completions | 15 |
C++ Completions | 2699 |
Rust Completions | 148 |
Total Stars | 2856 |
% of votes with a positive feedback rating | 90% of 10942 |
Total "Very Satisfied" Votes | 9036 |
Total "Somewhat Satisfied" Votes | 1697 |
Total "Not Satisfied" Votes | 209 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |