6 kyu
Find the unique number
53,434 of 152,023isqua
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 | 238143 |
Total Skips | 27941 |
Total Code Submissions | 679688 |
Total Times Completed | 152023 |
JavaScript Completions | 53434 |
PHP Completions | 3300 |
Python Completions | 57662 |
Java Completions | 16540 |
TypeScript Completions | 3450 |
Go Completions | 3134 |
C# Completions | 7819 |
Haskell Completions | 1014 |
Ruby Completions | 2895 |
F# Completions | 73 |
Swift Completions | 811 |
COBOL Completions | 19 |
D Completions | 10 |
C Completions | 1298 |
NASM Completions | 16 |
C++ Completions | 2795 |
Rust Completions | 175 |
Total Stars | 2885 |
% of votes with a positive feedback rating | 90% of 11035 |
Total "Very Satisfied" Votes | 9114 |
Total "Somewhat Satisfied" Votes | 1710 |
Total "Not Satisfied" Votes | 211 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |