input: Write a Python function to check if a given Tic Tac Toe board has a winning pattern.
  assert checkpattern([[1, 1, 1], [0, -1, 0], [-1, 0, 0]]) == True
  assert checkpattern([[1, 0, -1], [1, -1, 0], [1, 0, 0]]) == True
  assert checkpattern([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == False
output: def checkpattern(board):
      # Check rows and columns
      for i in range(3):
          if board[i][0] == board[i][1] == board[i][2] != 0:
              return True
          if board[0][i] == board[1][i] == board[2][i] != 0:
              return True
  
      # Check diagonals
      if board[0][0] == board[1][1] == board[2][2] != 0:
          return True
      if board[0][2] == board[1][1] == board[2][0] != 0:
          return True
  
      return False