Skip to main content
Count Good Nodes in Binary Tree | AlgoCracked
AlgoCracked
ProblemsCount Good Nodes in Binary Tree
Medium73.0% acceptance
Blind75TreeDfsBfs

Count Good Nodes in Binary Tree

A node is good if no node on the path from the root down to it has a strictly greater value. Return the number of good nodes. Input format Level-order JSON array with nulls, e.g. [[3,1,4,3,null,1,5]] . TreeNode is predefined.

Loading workspace…