Created
July 2, 2018 08:54
-
-
Save andhikamaheva/fd4c9abd0aa8fcf2a73054ea989afed6 to your computer and use it in GitHub Desktop.
Codility OddOccurrencesInArray 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) | |
let result = 0 | |
for (let i = 0; i < A.length; i++) { | |
result ^= A[i] | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment