Problems / Trees / Count Good Nodes in Binary Tree
#55 Medium Time O(n) Space O(n) Animated

Count Good Nodes in Binary Tree

Count nodes where path from root has no greater value.

LeetCode ↗
Approach: DFS (Pre-order)
Click play to start
Step 0 / 0
Press play to start the visualization.

Steps