4Sum || Two pointer || commented
\n vector<vector<int>> fourSum(vector<int> nums, int target) {\n        int n = nums.size();\n        vector<vector<int>> ans;\n        //store in set as we nee
```\n vector<vector<int>> fourSum(vector<int> nums, int target) {\n        int n = nums.size();\n        vector<vector<int>> ans;\n        //store in set as we need unique quadruplets  only\n        set<vector<int>> res;\n        \n        //less than 4 no ans\n        if(n < 4) return ans;\n        \n        sort(begin(nums),end(nums));\n        \n        for(int i=0;i<n;i++){\n            for(int j=i+1;j<n;j++){\n                //choose two pointer \n                int l = j+1 , r = n-1;\n                //calc rest req sum\n                int req = target-nums[i]-nums[j];\n                while(l < r){\n                    //if it is our sum take it and inc or dec pointer if we nums[l]==nums[l+1], or otherwise.\n                    if((nums[l]+nums[r]) == req){\n                        //take it\n                        res.insert({nums[i],nums[j],nums[l],nums[r]});\n                        if(nums[l] == nums[l+1]) l++;\n                        else r--;\n                    }\n                    //if the sum is greater than require dec last pointer to dec sum\n                    else if((nums[l]+nums[r]) > req){\n                        r--;\n                    }\n                    //otherwise inc\n                    else{\n                        l++;\n                    }\n                }\n            }\n        }\n        \n        for(auto it : res){\n            ans.push_back(it);\n        }\n        \n        return ans;\n    }\n```
['C']