this function calculates the chebyshev distance also known as the chessboard distance between two ndimensional points represented as lists https en wikipedia orgwikichebyshevdistance chebyshevdistance1 0 1 0 2 0 2 0 1 0 chebyshevdistance1 0 1 0 9 0 2 0 2 0 5 2 14 2 chebyshevdistance1 0 2 0 2 0 traceback most recent call last valueerror both points must have the same dimension this function calculates the chebyshev distance also known as the chessboard distance between two n dimensional points represented as lists https en wikipedia org wiki chebyshev_distance chebyshev_distance 1 0 1 0 2 0 2 0 1 0 chebyshev_distance 1 0 1 0 9 0 2 0 2 0 5 2 14 2 chebyshev_distance 1 0 2 0 2 0 traceback most recent call last valueerror both points must have the same dimension
def chebyshev_distance(point_a: list[float], point_b: list[float]) -> float:
    
    if len(point_a) != len(point_b):
        raise ValueError("Both points must have the same dimension.")

    return max(abs(a - b) for a, b in zip(point_a, point_b))