7 kyu
Lost number in number sequence
372 of 10,586evgv
Description:
An ordered sequence of numbers from 1 to N is given. One number might have deleted from it, then the remaining numbers were mixed. Find the number that was deleted.
Example:
- The starting array sequence is
[1,2,3,4,5,6,7,8,9]
- The mixed array with one deleted number is
[3,2,4,6,7,8,1,9]
- Your function should return the int
5
.
If no number was deleted from the starting array, your function should return the int 0
.
Note: N may be 1 or less (in the latter case, the first array will be []
).
Arrays
Algorithms
Similar Kata:
Stats:
Created | Jul 3, 2017 |
Published | Jul 3, 2017 |
Warriors Trained | 15382 |
Total Skips | 576 |
Total Code Submissions | 37984 |
Total Times Completed | 10586 |
PHP Completions | 372 |
Python Completions | 2982 |
JavaScript Completions | 3911 |
Java Completions | 1125 |
Ruby Completions | 342 |
C++ Completions | 813 |
C# Completions | 355 |
Swift Completions | 835 |
C Completions | 178 |
Rust Completions | 116 |
Total Stars | 122 |
% of votes with a positive feedback rating | 92% of 1712 |
Total "Very Satisfied" Votes | 1463 |
Total "Somewhat Satisfied" Votes | 214 |
Total "Not Satisfied" Votes | 35 |
Total Rank Assessments | 20 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |