Count Non Leaf Nodes Leetcode Solutions Extensions