← ALL NOTES
Tree

1448. Count Good Nodes in Binary Tree

A node is "good" if no node on the root-to-it path has a strictly greater value; count the good nodes. The property depends only on the maximum value seen so far on the path, which you carry down…

Loading…