Python || Beginners solution || Easy
\n# Code\n\nclass Solution:\n    def fourSum(self, nums: List[int], target: int) -> List[List[int]]:\n        ans = set()\n        nums.sort()\n        for i in
\n# Code\n```\nclass Solution:\n    def fourSum(self, nums: List[int], target: int) -> List[List[int]]:\n        ans = set()\n        nums.sort()\n        for i in range(len(nums)):\n            for j in range(i+1,len(nums)):\n                k,l = j+1,len(nums)-1\n                while k<l:\n                    s = nums[i]+nums[j]+nums[k]+nums[l]\n                    if s == target:\n                        ans.add((nums[i],nums[j],nums[k],nums[l]))\n                        l-=1\n                        k+=1\n                    elif s > target:\n                        l-=1\n                    else:\n                        k+=1\n                  \n        return ans\n```
['Python3']