Skip to content

Instantly share code, notes, and snippets.

@dexterbrylle
Last active December 21, 2015 05:10
Show Gist options
  • Save dexterbrylle/9d71f308dd8ca5634fce to your computer and use it in GitHub Desktop.
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.
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