leetle

Daily challenge for 2025-08-29

241. Gas Station

Given two integer arrays gas and cost, return the starting gas station's index if you can travel around the circuit once in the clockwise direction, otherwise return -1. If arrays are empty, return -1.

Example:
Input: gas = [1,2,3,4,5], cost = [3,4,5,1,2]
Output: 3

Run this challenge interactively in Python or JavaScript when the app loads.