• 2022-06-16 问题

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

  • 1