Find lowest common ancestor | LinkedIn Coding Question