Pergunta de entrevista da empresa Amazon

Write a function in C++ that will find if a node in a tree has 2 common ancestors