Largest Coordinate Gap

Chebyshev distance shows how far two points differ along their most extreme coordinate. Given two lists of the same length, a and b, find the absolute difference at each position. Return the largest of those differences.

Примеры

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

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

def chebyshev_distance(a: list[int], b: list[int]) -> int:

Теги

math
PostgreSQLv16

Hawn jidher ir-riżultat tat-tħaddim tal-kodiċi

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