HackerRank Cpp exception handling in C++ problem solution - TheCScience