Given the root of a complete binary tree, return the number of dominant nodes in the tree.
A node is considered dominant if its value is greater than or equal to the values of all nodes in its subtree.
Note: A subtree of a node consists of that node and all of its descendants.
Constraints:
The number of nodes in the tree is in the range
Node.val
The tree is guaranteed to be a complete binary tree.
Given the root of a complete binary tree, return the number of dominant nodes in the tree.
A node is considered dominant if its value is greater than or equal to the values of all nodes in its subtree.
Note: A subtree of a node consists of that node and all of its descendants.
Constraints:
The number of nodes in the tree is in the range
Node.val
The tree is guaranteed to be a complete binary tree.