+We need the minimum time to move through the given points in order. Movement options: in 1 second, move one unit vertically, one unit horizontally, or both (a diagonal move that effectively moves (±1, ±1) in one second). So when going from point A to B, if both x and y must change, a diagonal move can decrease both differences by 1 in a single second. Intuitively, you can keep moving diagonally until one axis difference is exhausted, then move straight for the remainder. That suggests the time between two points is the larger of the absolute differences in x and y (Chebyshev distance), i.e., max(|dx|, |dy|). Sum that for each consecutive pair.
0 commit comments