@@ -0,0 +1,769 @@
+class Solution:%0A    # @return a list of lists of length 4, %5B%5Bval1,val2,val3,val4%5D%5D%0A    def fourSum(self, num, target):%0A        numLen, res, dict = len(num), set(), %7B%7D%0A        if numLen %3C 4: return %5B%5D%0A        num.sort()%0A        for p in range(numLen):%0A            for q in range(p+1, numLen): %0A                if num%5Bp%5D+num%5Bq%5D not in dict:%0A                    dict%5Bnum%5Bp%5D+num%5Bq%5D%5D = %5B(p,q)%5D%0A                else:%0A                    dict%5Bnum%5Bp%5D+num%5Bq%5D%5D.append((p,q))%0A        for i in range(numLen):%0A            for j in range(i+1, numLen-2):%0A                T = target-num%5Bi%5D-num%5Bj%5D%0A                if T in dict:%0A                    for k in dict%5BT%5D:%0A                        if k%5B0%5D %3E j: res.add((num%5Bi%5D,num%5Bj%5D,num%5Bk%5B0%5D%5D,num%5Bk%5B1%5D%5D))%0A        return %5Blist(i) for i in res%5D%0A

Create FourSum_001.py