Lowest Common Ancestor Hackerrank Solution