Pergunta de entrevista da empresa Headlands Technologies

Solve this C++ question in under 2 hours