Clean C++ 19ms backtracking 81.90%
\nclass Solution {\npublic:\n    vector<vector<int>> fourSum(vector<int>& nums, int target) {\n        sort(nums.begin(), nums.end());\n        vector<vector<in
```\nclass Solution {\npublic:\n    vector<vector<int>> fourSum(vector<int>& nums, int target) {\n        sort(nums.begin(), nums.end());\n        vector<vector<int>>res;\n        vector<int>path;\n        DFS(res, nums, 0, target, 0, 0, path);\n        return res;\n    }\n    \n    void DFS(vector<vector<int>>& res, vector<int>& nums, int pos, int target, int count, int sum, vector<int>& path){\n        if(count == 4){\n            if(sum == target) res.push_back(path);\n            return;\n        }\n        for(int i = pos; i < nums.size(); i++){\n            if(i != pos && nums[i] == nums[i - 1]) continue;\n            if(sum + nums[i] + (3 - count) * nums[nums.size() - 1] < target) continue;\n            if(sum + (4 - count)* nums[i] > target) break;\n            path.push_back(nums[i]);\n            DFS(res, nums, i + 1, target, count + 1, sum + nums[i], path);\n            path.pop_back();\n        }\n    }\n};\n```
['Backtracking', 'C++']