Algorithm · Airbnb · Hard
You find yourself with a layover lasting exactly totalHours hours and wish to fill every moment by renting experiences. You are provided with a list experiences where each value is the duration in hours of a particular experience. You can rent any experience as many times as you like. Your objective is to determine the minimum number of experiences you must rent so that their total duration adds up precisely to totalHours hours. If it is impossible to reach exactly…
Checking your access…