6 kyu
Number Zoo Patrol
2,695 of 6,217shawkinsl
Description:
Background:
You're working in a number zoo, and it seems that one of the numbers has gone missing!
Zoo workers have no idea what number is missing, and are too incompetent to figure it out, so they're hiring you to do it for them.
In case the zoo loses another number, they want your program to work regardless of how many numbers there are in total.
Task:
Write a function that takes a shuffled list of unique numbers from 1
to n
with one element missing (which can be any number including n
). Return this missing number.
Note: huge lists will be tested.
Examples:
[1, 3, 4] => 2
[1, 2, 3] => 4
[4, 2, 3] => 1
Algorithms
Performance
Mathematics
Similar Kata:
Stats:
Created | Nov 3, 2013 |
Published | Nov 3, 2013 |
Warriors Trained | 11746 |
Total Skips | 681 |
Total Code Submissions | 40663 |
Total Times Completed | 6217 |
JavaScript Completions | 2695 |
C# Completions | 557 |
PHP Completions | 336 |
Java Completions | 617 |
Python Completions | 1858 |
Ruby Completions | 123 |
C Completions | 200 |
CoffeeScript Completions | 9 |
OCaml Completions | 4 |
Haskell Completions | 5 |
Total Stars | 210 |
% of votes with a positive feedback rating | 92% of 852 |
Total "Very Satisfied" Votes | 733 |
Total "Somewhat Satisfied" Votes | 100 |
Total "Not Satisfied" Votes | 19 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |