Back to all patterns

Tree DFS / Prefix Sum

1 problems • Practice on LeetCode to earn credits

About This Pattern

Master the Tree DFS / Prefix Sum pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Medium (1)

Path Sum III

Find number of paths that sum to a target value (path doesn't need to start at root).

Key Signals:

Prefix sumHash mapAll paths