An extended version of LeetCode 794 (Valid Tic-Tac-Toe State). Given a tic-tac-toe board state (represented as an array of strings), determine whether the board state is valid. A valid state must satisfy the rules of tic-tac-toe: X always goes first, so the count of X's is either equal to or…