skyscrapers.py
def check_horizontal_visibility(board: list) -> bool:
    """
    Check row-wise visibility (left-right and vice versa)

    Return True if all horizontal hints are satisfiable,
     i.e., for line 412453* , hint is 4, and 1245 are the four buildings
      that could be observed from the hint looking to the right.

    >>> check_horizontal_visibility(['***21**', '412453*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    True
    >>> check_horizontal_visibility(['***21**', '452453*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    False
    >>> check_horizontal_visibility(['***21**', '452413*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    False
    """
    for line in board[1:-1]:
        check = line[0]
        if check != '*':
            if not left_to_right_check(line, int(check)):
                return False

        check = line[-1]
        if check != '*':
            line = line[::-1]
            if not left_to_right_check(line, int(check)):
                return False
    return True

    Check row-wise visibility (left-right and vice versa)

    Return True if all horizontal hints are satisfiable,
     i.e., for line 412453* , hint is 4, and 1245 are the four buildings
      that could be observed from the hint looking to the right.

    >>> check_horizontal_visibility(['***21**', '412453*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    True
    >>> check_horizontal_visibility(['***21**', '452453*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    False
    >>> check_horizontal_visibility(['***21**', '452413*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    False
    
Check row-wise visibility (left-right and vice versa)
Return True if all horizontal hints are satisfiable,
i.e., for line 412453* , hint is 4, and 1245 are the four buildings
that could be observed from the hint looking to the right.


Check row - wise visibility ( left - right and vice versa ) Return True if all horizontal hints are satisfiable i . e . for line 412453 * hint is 4 and 1245 are the four buildings that could be observed from the hint looking to the right .
def check_horizontal_visibility(board: list) -> bool:
    for line in board[1:-1]:
        check = line[0]
        if check != '*':
            if not left_to_right_check(line, int(check)):
                return False
        check = line[-1]
        if check != '*':
            line = line[::-1]
            if not left_to_right_check(line, int(check)):
                return False
    return True
def check_horizontal_visibility ( board : list ) -> bool : for line in board [ 1 : - 1 ] : check = line [ 0 ] if check != '*' : if not left_to_right_check ( line , int ( check ) ) : return False check = line [ - 1 ] if check != '*' : line = line [ : : - 1 ] if not left_to_right_check ( line , int ( check ) ) : return False return True
Check row-wise visibility (left-right and vice versa)
Return True if all horizontal hints are satisfiable,
i.e., for line 412453* , hint is 4, and 1245 are the four buildings
that could be observed from the hint looking to the right.
Check row - wise visibility ( left - right and vice versa ) Return True if all horizontal hints are satisfiable i . e . for line 412453 * hint is 4 and 1245 are the four buildings that could be observed from the hint looking to the right .
"""
    Check row-wise visibility (left-right and vice versa)

    Return True if all horizontal hints are satisfiable,
     i.e., for line 412453* , hint is 4, and 1245 are the four buildings
      that could be observed from the hint looking to the right.

    >>> check_horizontal_visibility(['***21**', '412453*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    True
    >>> check_horizontal_visibility(['***21**', '452453*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    False
    >>> check_horizontal_visibility(['***21**', '452413*', '423145*', '*543215', \
        '*35214*', '*41532*', '*2*1***'])
    False
    """
board
list