PROBLEM LINK:
Author: admin6
Tester: admin6
Editorialist: admin6
DIFFICULTY:
EASY
PREREQUISITES:
tic-tac-toe(game)
PROBLEM:
You are given a state of the game(tic-tac-toe) in which 7 moves are alrady taken,
and you have to find if the current player can win the match or not.
QUICK EXPLANATION:
First we have to verify if the given state is valid or not. Given State can be invalid if either the move are
not in order of 3 & 4 (7 = 4 of first player + 3 of second player) or if the player has won the match in there previous moves.
Now for the next(8^{th}) move the player who has played 3 moves will get the chance.
DETAILED EXPLANATION
Store the board in 2D array , then try to place move at any of the free space . then check if Chef can win the match
or not , if he can’t win then try the next free space and do the same.
AUTHOR’S AND TESTER’S SOLUTIONS:
Author’s solution can be found here.