Path Sum II

Medium · Trees · about 20 minutes

Asked at Amazon, Meta, Bloomberg.

List every path that runs from the root down to a leaf and whose node values total targetSum. Write each path as the values from root to leaf; the paths can be listed in any order.

Related guides