Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andhikamaheva/fd4c9abd0aa8fcf2a73054ea989afed6 to your computer and use it in GitHub Desktop.
Save andhikamaheva/fd4c9abd0aa8fcf2a73054ea989afed6 to your computer and use it in GitHub Desktop.
Codility OddOccurrencesInArray Exercise Solution (JavaScript/NodeJS)
// 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