Where to start a full lap
Charging stations sit around a circular track, numbered in driving order. At station i you pick up charge[i] units of energy, and the drive from station i to the next one (after the last comes station 0) uses drain[i] units. You begin at a station of your choice with an empty battery of unlimited capacity. Return the smallest station index from which you can drive one full lap without the battery ever going below zero, or -1 if no station works.
Both lists have the same length (at least 1) and non-negative values. Aim for one pass.
Besides the tests, one large input (4,000 stations) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
lap_start([4,1,6,2], [5,3,2,3])→2lap_start([3,1,1], [2,2,2])→-1lap_start([4,1,1,2], [2,2,2,2])→0