Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Monday, Dec 7.Claim the deal

(This question is a variation of the LeetCode question 322. Coin Change. If you haven't completed that question yet, it is recommended to solve it first.)

You have an X-hour layover and want to fill the time entirely with rental experiences. Each experience has a fixed duration in hours, and you may book the same experience more than once. Your goal is to use the minimum number of bookings so that they sum to exactly totalHours hours.

Test Cases
Input
Output
Expected