You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 794.Valid Tic-Tac-Toe State.go
    path of file: ./repos/LeetCode-Go/leetcode/0794.Valid-Tic-Tac-Toe-State
    
    the code of the file until where you have to start completion: package leetcode

func validTicTacToe(board []string) bool {
	cntX, cntO := 0, 0
	for i := range board {
		for j := range board[i] {
			if boa
    
func validTicTacToe(board []string) bool {
	cntX, cntO := 0, 0
	for i := range board {
		for j := range board[i] {
			if board[i][j] == 'X' {
				cntX++
			} else if board[i][j] == 'O' {
				cntO++
			}
		}
	}
	if cntX < cntO || cntX > cntO+1 {
		return false
	}
	if cntX == cntO {
		return process(board, 'X')
	}
	return process(board, 'O')
}