只出现一次的数字 II class Solution { public: int singleNumber(vector& nums) { //使用异或的方式进行相应的计算 int len=nums.size(); int a=0,b=0; for(auto x:nums) { a=(x^a)&~b; b=(x^b)&~a; } return a; } };