1266. Minimum Time Visiting All Points

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1266

class Solution:
    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:
        return sum(
            max(abs(p1[0] - p2[0]), abs(p1[1] - p2[1])) for p1, p2 in pairwise(points)
        )