6 kyu
Find the unique number
16,841 of 156,159isqua
Description:
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 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 | 243538 |
Total Skips | 28261 |
Total Code Submissions | 692715 |
Total Times Completed | 156159 |
JavaScript Completions | 54654 |
PHP Completions | 3362 |
Python Completions | 59418 |
Java Completions | 16841 |
TypeScript Completions | 3591 |
Go Completions | 3262 |
C# Completions | 8009 |
Haskell Completions | 1022 |
Ruby Completions | 2921 |
F# Completions | 80 |
Swift Completions | 851 |
COBOL Completions | 21 |
D Completions | 10 |
C Completions | 1381 |
NASM Completions | 18 |
C++ Completions | 3011 |
Rust Completions | 234 |
λ Calculus Completions | 3 |
Total Stars | 2928 |
% of votes with a positive feedback rating | 90% of 11175 |
Total "Very Satisfied" Votes | 9235 |
Total "Somewhat Satisfied" Votes | 1723 |
Total "Not Satisfied" Votes | 217 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |