Created
August 2, 2017 15:52
-
-
Save luojiyin1987/7e54fe27d527e85fe1ed66d995b93560 to your computer and use it in GitHub Desktop.
Single Number
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
| func singleNumber(nums []int) int { | |
| result := 0 | |
| for _, x := range nums { | |
| result ^= x | |
| } | |
| return result | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment