1.数组中不等三元组的数目
Solution
class Solution {
public:
int unequalTriplets(vector<int>& nums) {
int n = nums.size();
int cnt = 0;
for(int i = 0;i < n;i++){
for(int j = i+1;j < n;j++){
for(int k = j+1;k < n;k++){
if(nums[i] != nums[j] && nums[i] != nums[k] && nums[k] != nums[j]){
cnt++;
}
}
}
}
return cnt;
}
};
标签:周赛,cnt,nums,int,三元组,++,320
From: https://www.cnblogs.com/TTS-TTS/p/17041697.html