4
LeetCode 第 136 题: 只出现一次的数字
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.
func singleNumber(nums []int) int {
number := nums[0]
for i:=1;i<len(nums);i++{
number ^= nums[i]
}
return number
}
- 本文链接: https://naturalgao.github.io/2022/03/15/LeetCode-第-136-题-只出现一次的数字/
- 版权声明: 本博客所有文章除特别声明外,均采用 CC BY 4.0 CN协议 许可协议。转载请注明出处!
NaturalGaoComputer Hobbyist
热爱计算机技术,对新技术有追求,热衷于用技术解决生活中的棘手问题
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK