Skip to content

Instantly share code, notes, and snippets.

@BiruLyu
Created May 25, 2017 18:25
Show Gist options
  • Select an option

  • Save BiruLyu/e0d3d93bb9d02f0c55d0f900844a9699 to your computer and use it in GitHub Desktop.

Select an option

Save BiruLyu/e0d3d93bb9d02f0c55d0f900844a9699 to your computer and use it in GitHub Desktop.
/*
x ^ 0 = x;
x ^ x = 0;
x ^ x ^ x = x;
*/
public class Solution {
public int singleNumber(int[] nums) {
int res = 0;
for(int num : nums){
res ^= num;
}
return res;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment