4

LeetCode 第 136 题: 只出现一次的数字

 2 years ago
source link: https://naturalgao.github.io/2022/03/15/LeetCode-%E7%AC%AC-136-%E9%A2%98-%E5%8F%AA%E5%87%BA%E7%8E%B0%E4%B8%80%E6%AC%A1%E7%9A%84%E6%95%B0%E5%AD%97/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
func singleNumber(nums []int) int {
number := nums[0]

for i:=1;i<len(nums);i++{
number ^= nums[i]
}

return number
}

NaturalGaoComputer Hobbyist

热爱计算机技术,对新技术有追求,热衷于用技术解决生活中的棘手问题

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK