HackerEarth Card game problem solution - TheCScience