HackerEarth Benny and Gifts problem solution - TheCScience