Maximize Circular Rover Travel
Updated
Problem statement
A circular route has length circumference. Each stops[i] = [position,fuel] has a distinct position. Choose any stop as the start and collect its fuel. Traveling one distance unit consumes one fuel.
Moving clockwise, collect each reached stop at most once. If fuel cannot reach the next uncollected stop, travel until fuel is exhausted. After collecting every stop, continue until remaining fuel is exhausted without collecting stops again. Return the maximum total distance traveled.
Function
maximumRoverDistance(circumference: int, stops: int[][]) → longExamples
Example 1
circumference = 100stops = [[0,10],[10,30],[60,40]]return = 80Start at 60, wrap to 0, then reach 10 and use the remaining fuel to stop at position 40 after 80 total distance.
Constraints
1 <= stops.length <= 2000.0 <= position < circumference.- Fuel amounts are nonnegative.
More Bloomberg LP Phone Screen questions
- N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
- Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
- Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
- Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026
- Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
Similar questions at other companies
- Climb Detection with Recoverable DipsStrava · PHONE SCREEN
- Evenly Schedule Vehicle InspectionsAmazon · PHONE SCREEN
- Experiment Bucket Allocation and RebalancingPinterest · PHONE SCREENPinterest interview questions
- Automation Pipeline, Part 3: Stage DurationPlaid · PHONE SCREENPlaid interview questions
- Generate an Optimal Portfolio Trading ReportPoint72 · PHONE SCREENPoint72 interview questions
- Future-Aware Cache EvictionBenchling · PHONE SCREENBenchling interview questions
- Conveyor Triplet PackagingGoogle · PHONE SCREENGoogle interview questions
- Priority, Expiration, and LRU EvictionTesla · PHONE SCREENTesla interview questions
- Text JustificationUber · PHONE SCREENUber interview questions
- Find GPU Capacity and Drain a NodeTogether AI · PHONE SCREEN
Bloomberg LP interview experiences
- Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
- Bloomberg SWE Intern Interview Questions: 68 Questions
- Bloomberg Interview Questions, Level Not Reported: 65 Questions
- Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
- Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
- Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)