def manhattan_distance(x0, y0, x1, y1):
    """
    Manhattan distance algorithm
    :param x0: x value of the first coordinate
    :param y0: y value of the first coordinate
    :param x1: x value of the second coordinate
    :param y1: y value of the second coordinate
    :return: manhattan distance
    """
    return abs(y1 - y0) + abs(x1 - x0)