PubMatic Interview Question

Find single valued subtree count.