Tictactoe play player A B 3 x 3 grid the rule TicTacToe areplayers turn place character square the player a place x character second player B place o charactersx o character place square fill onesThe game end nonempty character filling row column diagonalThe game end square nonemptyNo move play game overGiven 2D integer array move movesi rowi coli indicate ith play gridrowicoli return winner game exist a b in case game end draw return Draw if movement play return PendingYou assume move valid ie follow rule tictactoe grid initially a play Example 1input move 0020112122output AExplanation a win play firstexample 2input move 001101021020output BExplanation B winsexample 3input move 001120101221010222output DrawExplanation the game end draw move Constraints1 moveslength 9movesilength 20 rowi coli 2there repeat element movesmove follow rule tic tac toe