class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
if(nums.size() < ) return {};
set<vector<int>> res;
sort(nums.begin(),nums.end());
for(int i=;i < nums.size()-;i++){
for(int j=i+;j < nums.size()-;j++){
int cnt = target - nums[i] - nums[j];
for(int m=j+,n=nums.size()-;m < n;){
int sum = nums[m]+nums[n];
if(sum < cnt){m++;}
else if(sum > cnt){n--;}
else{
res.insert({nums[i],nums[j],nums[m],nums[n]});
m++;n--;
}
}
}
}
return vector<vector<int>>(res.begin(),res.end());
}
};