Back to Question

Path Sum III (Path in Tree)

Question Explain

Given the root of a binary tree and an integer `targetSum`, return the number of paths where the sum of the values equals `targetSum`. The path does not need to start or end at the root or a leaf. Use a HashMap for efficient path tracking.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.