Dsa
Dynamic Programming
Easy
Budget Distribution
You are responsible for distributing a budget across various projects while adhering to specific limits on each project's allocation. You want to maximize the total utilization of the assigned budget by potentially skipping the allocation to one project.
Input format:
The first line contains two integers n (1 <= n <= 100) - number of projects, and B (1 <= B <= 10^5) - total budget available.
The second line contains n integers representing the budget limit for each project.
Output format:
Print the maximum utilization of the budget after potentially skipping one project.
Example:
Input:
4 100
50 40 30 20
Output:
100
Key concepts
dynamic_programmingbudgetingallocation
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now