Medium
A node is good if no node on the path from the root to it has a greater value. Given the root, return the number of good nodes.
root
Input: root = [3,1,4,3,null,1,5] Output: 4
Input: root = [3,3,null,4,2] Output: 3