varsingleNumber=function(nums){//这个方法也可以做上面的题,i+=2,可以以此类推下去nums.sort();for(leti=0;i<nums.length;i+=3){if(nums[i]!==nums[i+1]){returnnums[i];break;}}};console.log(singleNumber([0,1,0,1,0,1,99]));()[/i][/i] A: [199] B: [12] C: [0] D: [99]
varsingleNumber=function(nums){//这个方法也可以做上面的题,i+=2,可以以此类推下去nums.sort();for(leti=0;i<nums.length;i+=3){if(nums[i]!==nums[i+1]){returnnums[i];break;}}};console.log(singleNumber([0,1,0,1,0,1,99]));()[/i][/i] A: [199] B: [12] C: [0] D: [99]
1