✅Accepted| | ✅Easy solution || ✅Short & Simple || ✅Best Method
\n# Code\n\nclass Solution {\npublic:\n    vector<vector<int>> fourSum(vector<int>& nums, long target) {\n        vector<vector<int>> ans;\n        sort(nums.be
\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> fourSum(vector<int>& nums, long target) {\n        vector<vector<int>> ans;\n        sort(nums.begin(), nums.end());\n        if(nums.size()<4)\n            return ans;\n        int n=nums.size();\n        for(int i=0;i<n-3;i++)\n        {\n            for(int j=i+1; j<n-2;j++)\n            {\n                long sum=target-nums[i]-nums[j];\n                int l=j+1, r=n-1;\n                vector<int> v(4);\n                while(l<r)\n                {\n                    if(nums[l]+nums[r]==sum)\n                    {\n                        v[0]=nums[i];\n                        v[1]=nums[j];\n                        v[2]=nums[l];\n                        v[3]=nums[r];\n                        ans.push_back(v);\n                        while(l<r && v[2]==nums[l])\n                            l++;\n                        while(l<r && v[3]==nums[r])\n                            r--;\n                    }\n                    else if(nums[l]+nums[r]<sum)\n                        l++;\n                    else\n                        r--;\n                }\n                while(j<n-2 && nums[j]==nums[j+1])\n                    j++;\n            }\n            while(i<n-3 && nums[i]==nums[i+1])\n                i++;\n        }\n        return ans;\n    }\n};\n```\nPlease **UPVOTE** if it helps \u2764\uFE0F\uD83D\uDE0A\nThank You and Happy To Help You!!
['C++']