1266. Minimum Time Visiting All Points

Обновлено: 2024-03-12
1 мин
[]

Содержание

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)
        )