HackerRank Magic Spells in C++ problem solution - TheCScience