Valeo interview question

Solve a problem using C++ via online compiler.