Pregunta de entrevista de S&P Global

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