Given the root of a binary tree, a node X is considered good if on the path from the root to X, there are no nodes with a value greater than X.
Return the total number of good nodes in the binary tree.
Constraints:
The number of nodes in the binary tree is in the range
Node.val
Given the root of a binary tree, a node X is considered good if on the path from the root to X, there are no nodes with a value greater than X.
Return the total number of good nodes in the binary tree.
Constraints:
The number of nodes in the binary tree is in the range
Node.val