code: def threeSum(self, nums):
      res = []
      nums.sort()
      ls = len(nums)
      for i in range(ls - 2):
          if i > 0 and nums[i] == nums[i - 1]:
              continue
          j = i + 1
          k = ls - 1
          while j < k:
              curr = nums[i] + nums[j] + nums[k]
              if curr == 0:
                  res.append([nums[i], nums[j], nums[k]])
                  while j < k and nums[j] == nums[j + 1]:
                      j += 1
                  while j < k and nums[k] == nums[k - 1]:
                      k -= 1
                  j += 1
                  k -= 1
              elif curr < 0:
                  j += 1
              else:
                  k -= 1
      return res
  
label_desc: Use image node_id 1 for calling the Solution obj's underlying member method code with example usage: obj.threeSum(nums) and returns: res