

'''simple docstring'''



def   lowerCamelCase__       (      a__			,      a__			,      a__			,      a__)		->    int:



    """simple docstring"""







    return len_board * len_board_column * row + column

def   lowerCamelCase__       (      a__			,      a__			,      a__			,      a__			,      a__			,      a__			,      )		->    bool:



    """simple docstring"""







    if board[row][column] != word[word_index]:
        return False

    if word_index == len(a__) - 1:
        return True

    _snake_case : Optional[int]												=		[(0, 1), (0, -1), (-1, 0), (1, 0)]
    _snake_case : Optional[Any]												=		len(a__)
    _snake_case : Optional[int]												=		len(board[0])
    for direction in traverts_directions:
        _snake_case : Union[str, Any]												=		row + direction[0]
        _snake_case : Optional[int]												=		column + direction[1]
        if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
            continue

        _snake_case : Dict												=		get_point_key(a__			,      a__			,      a__			,      a__)
        if key in visited_points_set:
            continue

        visited_points_set.add(a__)
        if exits_word(a__			,      a__			,      a__			,      a__			,      word_index + 1			,      a__):
            return True

        visited_points_set.remove(a__)

    return False

def   lowerCamelCase__       (      a__			,      a__)		->    bool:



    """simple docstring"""







    _snake_case : Optional[int]												=		(
        'The board should be a non empty matrix of single chars strings.'
    )

    _snake_case : Dict												=		len(a__)
    if not isinstance(a__			,      a__) or len(a__) == 0:
        raise ValueError(a__)

    for row in board:
        if not isinstance(a__			,      a__) or len(a__) == 0:
            raise ValueError(a__)

        for item in row:
            if not isinstance(a__			,      a__) or len(a__) != 1:
                raise ValueError(a__)

    # Validate word
    if not isinstance(a__			,      a__) or len(a__) == 0:
        raise ValueError(
            'The word parameter should be a string of length greater than 0.')

    _snake_case : Any												=		len(board[0])
    for i in range(a__):
        for j in range(a__):
            if exits_word(
                a__			,      a__			,      a__			,      a__			,      0			,      {get_point_key(a__			,      a__			,      a__			,      a__)}):
                return True

    return False


if __name__ == "__main__":
   import doctest

   doctest.testmod()






'''simple docstring'''



from __future__ import annotations

def   lowerCamelCase__       (      a__)		->    int | float:



    """simple docstring"""







    _snake_case : int												=		sorted(a__)
    _snake_case : List[str]												=		len(a__)
    _snake_case : Union[str, Any]												=		length >> 1
    return (
        (sorted_list[mid_index] + sorted_list[mid_index - 1]) / 2
        if length % 2 == 0
        else sorted_list[mid_index]
    )

def   lowerCamelCase__       (      )		->    Union[str, Any]:



    """simple docstring"""







    import doctest

    doctest.testmod()


if __name__ == "__main__":
   main()



