Code Eval solutions in c++