Skip to content

Instantly share code, notes, and snippets.

@GarthStevens5
Last active April 28, 2018 18:39
Show Gist options
  • Save GarthStevens5/9d22a280d55e1f239aaec730ca2a7ba5 to your computer and use it in GitHub Desktop.
Save GarthStevens5/9d22a280d55e1f239aaec730ca2a7ba5 to your computer and use it in GitHub Desktop.
JS Check for all Odd occurrences of an integer.
function findOdd(A) {
var num;
var count = 0;
for(i=0;i<A.length;i++){
num = A[i]
for(a=0;a,a<A.length;a++){
if(A[a]==num){
count++;
}
} if(count%2!=0){
return num;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment