Count Good Nodes in Binary Tree — Step-by-Step Visualization
mediumLeetCode #1448TreeDFSBinary Tree
A node X is good if on the path from root to X there are no nodes with a value greater than X. Return the number of good nodes using DFS — track the running max as you descend.