As reported: PayPal Senior Software Engineer (Python), DSA round (2026): LeetCode Gas Station.
There are n gas stations on a circular route. Station i has gas[i] fuel, and driving from station i to station i + 1 (wrapping around) costs cost[i] fuel. Your car's tank is unlimited and starts empty. Return the index of the station from which you can travel around the circuit once clockwise, or -1 if it is impossible. If a solution exists, it is unique.
This is LeetCode 134 — Gas Station.
Example 1
gas = [1,2,3,4,5], cost = [3,4,5,1,2] -> 3
Example 2
gas = [2,3,4], cost = [3,4,3] -> -1
Constraints: 1 ≤ n ≤ 10^5; 0 ≤ gas[i], cost[i] ≤ 10^4.
Code runner format: one JSON value per line (LeetCode's test-case format): gas, then cost. Implement canCompleteCircuit(gas, cost); the harness prints the index.