Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luojiyin1987/7e54fe27d527e85fe1ed66d995b93560 to your computer and use it in GitHub Desktop.
Save luojiyin1987/7e54fe27d527e85fe1ed66d995b93560 to your computer and use it in GitHub Desktop.
Single Number
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