Search⌘ K
AI Features

Solution: Gas Station

Solution: Gas Station gives gas supplies and travel costs for a circular route. Find the unique station where a car can start empty, complete the full trip, and return there, or return -1 if impossible.

Statement

There are nn gas stations along a circular route, where the amount of gas at the ithi^{th} ...