6 kyu
Find the unique number
1,840 of 2,114kayahr
Description:
Write a function called findUnique
which returns the only unique number from an array.
All numbers in the unsorted array are present twice, except the one you have to find. The numbers are always valid integer values between 1 and 2147483647, so no need for type and error checking. The array contains at least one number and may contain millions of numbers. So make sure your solution is optimized for speed.
Example
Input:
[ 1, 8, 4, 4, 6, 1, 8 ]
Expected output:
6
Arrays
Performance
Fundamentals
Similar Kata:
Stats:
Created | Sep 15, 2015 |
Published | Sep 15, 2015 |
Warriors Trained | 4447 |
Total Skips | 126 |
Total Code Submissions | 8067 |
Total Times Completed | 2114 |
JavaScript Completions | 1840 |
Haskell Completions | 178 |
Ruby Completions | 138 |
Total Stars | 87 |
% of votes with a positive feedback rating | 92% of 346 |
Total "Very Satisfied" Votes | 297 |
Total "Somewhat Satisfied" Votes | 44 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 34 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |