IPL Franchise Budget Allocation
IPL Franchise Budget Allocation
Priya, an IPL franchise manager, has a budget for player auctions. She must purchase players in order without skipping, selecting from available players. Find the maximum number of consecutive players she can buy within her budget constraint. Rule: return the maximum length of a CONTIGUOUS run of players whose total price fits within the budget. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Given an array of player base prices and a budget limit, find the maximum count of consecutive players (from any starting position) that can be purchased.
Input
Output
More Arrays problems
Browse all coding problems →Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards