Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Robots Within Budget

med
30 min
Try to solve the Maximum Number of Robots Within Budget problem.

Statement

You are given two 00 indexed integer arrays chargeTimes and runningCosts, both of length nn, and an integer budget. There are nn robots, where the ii-th robot has a charge time of chargeTimes[i] and a running cost of runningCosts[i].

You want to run a contiguous sequence of kk robots. The total cost of running kk consecutive robots from index ll to index rr (where k=r−l+1k = r - l + 1) is defined as:

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Robots Within Budget

med
30 min
Try to solve the Maximum Number of Robots Within Budget problem.

Statement

You are given two 00 indexed integer arrays chargeTimes and runningCosts, both of length nn, and an integer budget. There are nn robots, where the ii-th robot has a charge time of chargeTimes[i] and a running cost of runningCosts[i].

You want to run a contiguous sequence of kk robots. The total cost of running kk consecutive robots from index ll to index rr (where k=r−l+1k = r - l + 1) is defined as: