Skip to content

Instantly share code, notes, and snippets.

@esase
Created April 14, 2022 16:32
Show Gist options
  • Save esase/42a2fdade63da7df07e00616883639df to your computer and use it in GitHub Desktop.
Save esase/42a2fdade63da7df07e00616883639df to your computer and use it in GitHub Desktop.
/**
* @param {number[]} nums
* @return {number}
*/
var singleNumber = function(nums) {
let result = 0;
for (let value of nums) {
result ^= value;
}
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment