






def   snake_case		(				UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int ):
				return len_board * len_board_column * row + column







def   snake_case		(				UpperCAmelCase						:							list[list[str]],    UpperCAmelCase						:							str,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							int,    UpperCAmelCase						:							set[int],    ):

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

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

				A									=   [(0, 1), (0, -1), (-1, 0), (1, 0)]
				A									=   len(UpperCAmelCase )
				A									=   len(board[0] )
				for direction in traverts_directions:
								A									=   row + direction[0]
								A									=   column + direction[1]
								if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
												continue

								A									=   get_point_key(UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase,    UpperCAmelCase )
								if key in visited_points_set:
												continue

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

								visited_points_set.remove(UpperCAmelCase )

				return False







def   snake_case		(				UpperCAmelCase						:							list[list[str]],    UpperCAmelCase						:							str ):
				A									=   (
				    'The board should be a non empty matrix of single chars strings.'
				)

				A									=   len(UpperCAmelCase )
				if not isinstance(UpperCAmelCase,    UpperCAmelCase ) or len(UpperCAmelCase ) == 0:
								raise ValueError(UpperCAmelCase )

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

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

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

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

				return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()













def   snake_case		(				UpperCAmelCase						:							set,    UpperCAmelCase						:							set ):
				assert isinstance(UpperCAmelCase,    UpperCAmelCase ), f'The input value of [set_a={set_a}] is not a set'
				assert isinstance(UpperCAmelCase,    UpperCAmelCase ), f'The input value of [set_b={set_b}] is not a set'

				return {a + b for a in set_a for b in set_b}


if __name__ == "__main__":
					from doctest import testmod

					testmod()





