Algorithm · ByteDance · Medium
You are handed the current state of an $$n \times n$$ Tic-Tac-Toe board. Implement a function GameOver(board) that decides whether the game has reached its end. The function should return True if either of these holds: some player has filled an entire row, an entire column, or one of the two main diagonals with their own mark, or the board has no empty cells left and nobody has won. It should return False while the game is still going on. This first task works directly on…