Given gas and cost arrays for a circular route, find the starting gas station index to complete the circuit, or -1.
Input: gas=[1,2,3,4,5], cost=[3,4,5,1,2] Output: 3 Input: gas=[2,3,4], cost=[3,4,3] Output: -1
Unlock hints progressively β start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features