Problem Statement
A Tic-Tac-Toe board is given after some moves are played.
Find out if the given board is valid, i.e., is it possible
to reach this board position after some moves or not.
Note that every arbitrary filled grid of 9 spaces isn’t valid
e.g. a grid filled with 3 X and 6 O isn’t valid situation because
each player needs to take alternate turns.
Note : The game starts with X
Example 1:
2
X X O O X O O O O
X X O O O X X O X
>> Invalid
>> Valid
Example 2:
1
O X X X O X O O X
>> Invalid
>> Valid
