Company: Amazon_5april
Difficulty: medium
You're an SDE responsible for keeping your team's Amazon CodeBuild pipeline fast. There are n on-demand build agents in the pool, and each agent i needs buildTime[i] minutes to run a single unit-test. Ahead of the next commit you must schedule exactly tests number of unit-tests, but the release manager insists the whole suite finish within timeBudget minutes. You may assign any non-negative number of tests to each agent (some agents can be idle). If an agent receives assigned[i] tests, it spends assigned[i] × buildTime[i] minutes. The total time taken is the sum of the time taken by all agents and must not exceed timeBudget . Count every distinct assignment of the unit-tests across the agents that satisfies the time budget. The tests are run on the agent sequentially and the total time taken should not exceed timeBudget . Because the answer can be huge, return it modulo 10 9 + 7. Example n = 3 agents tests = 3 timeBudget = 3 buildTime = [1, 1, 1] All 10 valid assignments are list