Last active
December 21, 2015 05:10
-
-
Save dexterbrylle/9d71f308dd8ca5634fce to your computer and use it in GitHub Desktop.
Given a list of all the numbers from 1 to 100 not in any particular order, and the user always deletes the 2nd number from that list. Write an algo to identify the number that the user deleted.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < arrIntegerList.length; i++) { | |
if (i === 1) { | |
console.log('User deleted -> ' + arrIntegerList[i]); | |
} else { | |
console.log(i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment