':type nums: List[int]
:rtype: List[List[int]]'

def threeSum2(self, nums):

    d = collections.Counter(nums)
    nums_2 = [x[0] for x in d.items() if (x[1] > 1)]
    nums_new = sorted([x[0] for x in d.items()])
    rtn = ([[0, 0, 0]] if (d[0] >= 3) else [])
    for (i, j) in enumerate(nums_new):
        if (j <= 0):
            numss2 = nums_new[(i + 1):]
            for (x, y) in enumerate(numss2):
                if ((((0 - j) - y) in [j, y]) and (((0 - j) - y) in nums_2)):
                    if (sorted([j, y, ((0 - j) - y)]) not in rtn):
                        rtn.append(sorted([j, y, ((0 - j) - y)]))
                if ((((0 - j) - y) not in [j, y]) and (((0 - j) - y) in nums_new)):
                    if (sorted([j, y, ((0 - j) - y)]) not in rtn):
                        rtn.append(sorted([j, y, ((0 - j) - y)]))
    return rtn
