原题链接:https://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-ii-lcof/
int singleNumber(vector
<int>& nums
) {
int ones
= 0, twos
= 0;
for (int num
: nums
) {
ones
= ones
^ num
& ~twos
;
twos
= twos
^ num
& ~ones
;
}
return ones
;
}
转载请注明原文地址:https://blackberry.8miu.com/read-4797.html