Company: Harness On campus Sdet_19march
Difficulty: medium
In Harness Cloud Cost Management, a budget of compute credits must be distributed across a set of cloud services. Each service has its own spending cap — a maximum number of credits it can consume. The total budget must be fully allocated with no credits left over. Given a total credit budget and the spending cap for each service, count the number of distinct ways to allocate the entire budget across all services such that no service exceeds its cap. Since the answer can be very large, return it modulo 1000000007. Example budget = 4 caps = [1, 2, 3] Three services with caps 1, 2, and 3 must share exactly 4 credits: Service 1 gets 0, Service 2 gets 1, Service 3 gets 3 -> (0,1,3) Service 1 gets 0, Service 2 gets 2, Service 3 gets 2 -> (0,2,2) Service 1 gets 1, Service 2 gets 0, Service 3 gets 3 -> (1,0,3) Service 1 gets 1, Service 2 gets 1, Service 3 gets 2 -> (1,1,2) Service 1 gets 1, Service 2 gets 2, Service 3 gets 1 -> (1,2,1) Return 5 Function Description Comple