Fastest Grid Route

Imagine a character moving on a grid map: in one step, they can move horizontally, vertically, or diagonally. Given a list of points points, visit them strictly in the given order. Return the minimum time needed to complete the whole route.

Примеры

Ввод
[[1, 1], [3, 4], [-1, 0]]
Вывод
7
Ввод
[[3, 2], [-2, 2]]
Вывод
5
Ввод
[[0, 0]]
Вывод
0

Нужно реализовать

def min_time_to_visit_all_points(points: list[list[int]]) -> int:

Теги

arraymath
PostgreSQLv16
Entre para enviar

O resultado da execução do código aparecerá aqui

Visible tests
1
Input
[[1,1],[3,4],[-1,0]]
Expected7
2
Input
[[3,2],[-2,2]]
Expected5
3
Input
[[0,0]]
Expected0
4
Input
[[1,1],[1,1]]
Expected0
5
Input
[[0,0],[5,5]]
Expected5
6
Input
[[-1,0],[3,4],[1,1]]
Expected7
Focus radio
Paused · SomaFM · Fluid