Design LCA and find K closest points | Meta Interview Question