Find cheapest common ancestor in a tree | Google Interview Question