Given a circular route of N petrol pumps, each with an amount of petrol and distance to the next pump, find the starting index such that a truck can complete the circuit without running out of fuel.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.