🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Greedy Algorithms Quiz: all 8 questions

Greedy Algorithms Quiz · Question 7 of 8

In Gas Station, if the running tank goes negative at station i, the next candidate start is…

In Gas Station, if the running tank goes negative at station i, the next candidate start is…

  1. A.Station 0
  2. B.Station i
  3. C.Station i + 1
  4. D.The station with the most gas
Answer & explanation

Correct answer: Station i + 1

No station from the current start up to i can complete the circuit, so start after i.

Can you get the rest right without peeking?

Take the timed Greedy Algorithms Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →