Leetcode 134. Gas Station
Given two arrays gas and cost around a circular route, find the unique starting station index from which you can travel clockwise once without your running fuel (gas[i] - cost[i] cumulative) ever dropping below zero, or return -1 if impossible. The key is that a solution exists iff total gas >= total cost, and you must pick the start where the running sum never becomes negative.
Asked at:
Bloomberg
Expedia
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early June, 2026
Expedia
Mid-level
Late March, 2026
Bloomberg
Senior
Late January, 2025
Bloomberg
Junior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.