think-cell interview question

Solve a task using C++ standard library.