Loading page…
A running balance is one number updated at each step, and when it drops below zero every earlier start is ruled out, so the scan restarts from the next step. On a circle the total decides if any start works. When an answer depends on both neighbours, one pass from each side gives two lower bounds, and combining them gives the answer. Neither scan needs a sort, and a size limit or a rule that is not one-sided breaks them.
Your team lead says: a hiker walks a circular trail past six huts.