Leetcode - 1448 Count Good Nodes in Binary Tree (Medium) in Java,Python