Sponsored
Use these hints if you're stuck. Try solving on your own first.
It is always optimal to buy the least expensive ice cream bar first.
Sort the prices so that the cheapest ice cream bar comes first.
Solve with full IDE support and test cases