Scribd's mobile reading experience may need lightweight game-state logic for interactive content. Given a legal sequence of Tic-Tac-Toe moves, determine whether player A won, player B won, the game is a draw, or play is still pending.
Players alternate turns, with A moving first. The board has three rows and three columns. A player wins immediately after placing a mark in an entire row, column, or diagonal. The input sequence stops when the game ends or when all nine cells are filled.
Implement tictactoe(moves), where moves is a list of coordinate pairs. The first pair belongs to A, the second to B, and so on. Return one of the strings "A", "B", "Draw", or "Pending".
def tictactoe(moves):