def gradient(x1: int, x2: int) -> int:
    """Calculate value and direction of change of x1 to
    get closer to x2. It can be one: -1, 0, 1
    """

    if x1 == x2:
        return 0

    dx = x1 - x2
    return int(dx / abs(dx))