Pergunta de entrevista da empresa S&P Global

Find the nearest common parent to two given nodes in a tree.