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
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterVisible tests
1
Input
[1,2,3], [4,5,6]Expected
32
Input
[1,2], [1,2]Expected
03
Input
[-1,-2], [4,3]Expected
54
Input
[0], [10]Expected
105
Input
[-1], [4,3]Expected
56
Input
[1,2], [2,1]Expected
1Focus radio
Paused · SomaFM · Fluid