Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Robots Within Budget

Maximum Number of Robots Within Budget asks for the largest contiguous group of robots affordable under budget. Its cost is its highest charge time plus its size times the sum of running costs.

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

Maximum Number of Robots Within Budget asks for the largest contiguous group of robots affordable under budget. Its cost is its highest charge time plus its size times the sum of running costs.

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: