• + 0 comments

    Nice problem: treat it as circular gas stations with capacity C. Compute d[i]=a[i]-b[i], use prefix sums on doubled array, and pick starts where window min prefix doesn’t drop below baseline and fuel never exceeds C monotonic queue helps. Booked Boston Logan Car Service during my layover just logistics. How did you enforce capacity?