def compare_list(list1: list, list2: list) -> bool:
    """Compare two list and ignore \n at the end of two list."""
    while list1[-1] == "\n" or list1[-1] == "":
        list1.pop()
    while list2[-1] == "\n" or list2[-1] == "":
        list2.pop()
    return list1 == list2