Created
July 3, 2018 03:53
-
-
Save andhikamaheva/367e44a7830b5349914228bd95ffd8bf to your computer and use it in GitHub Desktop.
Codility PerMissingElem Exercise Solution (JavaScript/NodeJS)
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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(A) { | |
// write your code in JavaScript (Node.js 8.9.4) | |
A.sort(function (a,b) { | |
return a - b | |
}) | |
let result = 1 | |
let i = 0 | |
while (result === A[i]) { | |
result++ | |
i++ | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function solution(A) {
}