Count Non Leaf Nodes Leetcode Solutions Java