Skip to content

Instantly share code, notes, and snippets.

@charlieInDen
Created August 1, 2020 07:02
Show Gist options
  • Save charlieInDen/9ef6192aea92e47089e1d88680dcfcd5 to your computer and use it in GitHub Desktop.
Save charlieInDen/9ef6192aea92e47089e1d88680dcfcd5 to your computer and use it in GitHub Desktop.
class Solution {
func singleNumber(_ nums: [Int]) -> Int {
var result = 0
nums.forEach { (num) in
result = result ^ num
}
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment