136. Single Number
🟩 Easy
Solution
My Solution
func singleNumber(nums []int) int {
for i:=1; i<len(nums); i++ {
nums[0] ^= nums[i]
}
return nums[0]
}

Leetcode: link
Last updated
Was this helpful?
🟩 Easy
My Solution
func singleNumber(nums []int) int {
for i:=1; i<len(nums); i++ {
nums[0] ^= nums[i]
}
return nums[0]
}
Leetcode: link
Last updated
Was this helpful?