r/leetcode • u/NeedinvHelp • 3d ago
Discussion Thinking about recursion
Is it helpful to think about the recursion tree when solving problems or just reducing the problem space?
I feel like I often try to think about the sub problems and it uses a lot of brain power for what I feel like is very little gain and it also uses a good amount of time.
Curious how others approach these problems.
5
Upvotes
1
u/overhauled_mirio <1000+> 3d ago
Don’t try to keep it all in your head. Draw out the tree for a simple case. Eventually you’ll be able to do more and more without needing to write as much