input: Write a python function to check the winner of a Tic Tac Toe game.
  assert check_if_win() == None  # Initial state, no winner
  board = ["X", "X", "X", "-", "-", "-", "-", "-", "-"]
  assert check_if_win() == "X"  # X wins in the first row
  board = ["-", "-", "-", "O", "O", "O", "-", "-", "-"]
  assert check_if_win() == "O"  # O wins in the second row
  board = ["-", "-", "-", "-", "-", "-", "X", "X", "X"]
  assert check_if_win() == "X"  # X wins in the third row
output: def check_if_win(board):
      # Check rows
      for i in range(0, 9, 3):
          if board[i] == board[i+1] == board[i+2] != "-":
              return board[i]
      
      # Check columns
      for i in range(3):
          if board[i] == board[i+3] == board[i+6] != "-":
              return board[i]
      
      # Check diagonals
      if board[0] == board[4] == board[8] != "-":
          return board[0]
      if board[2] == board[4] == board[6] != "-":
          return board[2]
      
      return None