from typing import List
from typing import Tuple


def stretch_in_row_or_column(
    stretched_list: list, two_coordinates: tuple
) -> List[Tuple[int, int]]:
    """
    Update a list of coordinates by coordinates between two boundaries of a line.
    Form a line in horizontal or vertical direction.

    Args:
        stretched_list (list): list of coordinates as tuples
        two_coordinates (tuple): two boundaries (coordinates) of a line

    Returns:
        List[Tuple[int, int]]: updated list of coordinates
    """
    updated_stretched_list: list = stretched_list[::]
    (x1, y1), (x2, y2) = two_coordinates
    updated_stretched_list.extend(two_coordinates)
    # movement in row
    if y1 == y2 and (abs(x1 - x2) != 1):
        difference = x1 - x2
        if difference < 1:
            for n in range(1, abs(difference)):
                updated_stretched_list.append((x1 + n, y1))
        elif difference > 1:
            for n in range(1, abs(difference)):
                updated_stretched_list.append((x1 - n, y1))

    # movement in column
    elif x1 == x2 and (abs(y1 - y2) != 1):
        difference = y1 - y2
        if difference < 1:
            for n in range(1, abs(difference)):
                updated_stretched_list.append((x1, y1 + n))
        elif difference > 1:
            for n in range(1, abs(difference)):
                updated_stretched_list.append((x1, y1 - n))

    return updated_stretched_list