Basic strategy I would use to implement strangeCount:
if(node == null || node is a leaf node) return 0. //At a leaf node we're done recursing //we know that left and right node can't both be null at this point if(left == null){ return 1 + strangeCount(right); } if (right == null) { return 1 + strangeCount(left); } //both not null return strangeCount(left) + strangeCount(right);