Intervals that just touch still meet.
transcript
They stand ten metres apart. Each walks one metre a minute. When can they meet? Look at the intervals. Let me show you the trap. The answer is a whole number of minutes.
At minute five, one friend reaches minus five to five. The other reaches five to fifteen. They touch at the point five. Use at most, and the answer is five. A strict check is one minute late. Strict checks hide in many solutions.
Find the largest left end. Find the smallest right end. They meet when left is at most right. Equal still counts. Test two friends who touch. Test one friend alone.
Minutes run up to a million. The search needs twenty steps. Each step reads every friend once. A million minutes need only twenty steps. The loop itself is the one you know. Only the check changes.
Use at most. Test two friends who touch. Test a single friend. Full breakdown in the lecture.