HackerRank Classes and Objects in C++ problem solution - TheCScience