HackerEarth Sum of cards problem solution - TheCScience