Path Sum II Problem

Path Sum II Problem — ExecCode Medium DSA Practice

Solve the Path Sum II problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Path Sum II. DFS collect paths. For Path Sum II, focus on the exact input variables, return only the requested value, and preserve the required time complexity for the intended pattern.

Examples

Input root = [5, 4, 8, 11, null, 13, 4], target = 22; Output [[5, 4, 11, 2], [5, 8, 4, 5]]

Constraints

0 ≤ nodes ≤ 10^4

Practice Path Sum II free on ExecCode. Browse DSA problems, topic map, and placement guides.