code: def path_sum2(root, s):
      if root is None:
          return []
      res = []
      stack = [(root, [root.val])]
      while stack:
          node, ls = stack.pop()
          if node.left is None and node.right is None and sum(ls) == s:
              res.append(ls)
          if node.left is not None:
              stack.append((node.left, ls + [node.left.val]))
          if node.right is not None:
              stack.append((node.right, ls + [node.right.val]))
      return res
  
label_desc: Use image node_id 3 for calling a global function with example usage: path_sum2(root, s) and returns: res, list