class Solution {
public:
int singleNumber(vector<int>& nums) {
sort(nums.begin(),nums.end());
for(int i=0;i<nums.size();i+=3){
if(i==nums.size()-1||nums[i]!=nums[i+1]){
return nums[i];
}
}
return 0;
}
};
137. Single Number II
最新推荐文章于 2022-01-26 11:09:47 发布