6sense Interview Question

First round : Unival subtree problem Second round : Prefix sum problem