cppsecrets.com interview question

C++ program to print common nodes on path from root