python只能调用ctypes来做吹了位运算的结果了
class Solution:
def foundOnceNumber(self , arr , k ):
# write code here
res = 0
for i in range(32):
cur = 0
for t in arr:
cur += (t >> i) & 1
res ^= (cur % k) << i
import ctypes
return ctypes.c_int(res).value
京公网安备 11010502036488号