Created
May 25, 2017 18:25
-
-
Save BiruLyu/e0d3d93bb9d02f0c55d0f900844a9699 to your computer and use it in GitHub Desktop.
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
| /* | |
| 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