Google Interview Question

Find ancestor in the tree