Pregunta de entrevista de Matic

Implement C++ challenge, cannot share here.