python
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14class Solution: def singleNumber(self, nums: List[int]): res = 0 for i in range(32): count = 0 for num in nums: count += (num >> i) & 1 if count % 3 != 0: res += pow(2, i) return res if (res>>31) & 1 == 0 else -((res^0xffffffff)+1)
最后
以上就是等待豆芽最近收集整理的关于只出现一次的数字II-位运算137-python的全部内容,更多相关只出现一次内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复