ice cream parlor hackerrank solution in c