CTCI 4.7 find common ancestor of two nodes