Phantom AI Interview Question

Typical coding problem in C++