Created
April 8, 2018 17:08
-
-
Save platypusrex/0e4b23821a44f4f7d851dd79742dd195 to your computer and use it in GitHub Desktop.
Given an array, find the int that appears an odd number of times.
This file contains hidden or 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
const findOdd = (arr) => arr.reduce((a,b) => a ^ b); | |
findOdd([1,1,2,-2,5,2,4,4,-1,-2,5]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment