LCC '21 Contest 2 J2 - 1D Tic-Tac-Toe

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Oscar and Xyla find tic-tac-toe to be a bit too challenging, so they've invented a new game: 1D tic-tac-toe.

Unlike regular tic-tac-toe which is played on a 3 \times 3 grid, 1D tic-tac-toe is played on a 1 \times N sized board. For Oscar to win, he needs to place three Os in a row. For Xyla to win, she needs to place three Xs in a row.

After completing their game of 1D tic-tac-toe, they would like to figure out who won. Output Oscar Wins if the board contains three Os in a row. Output Xyla Wins if the board contains three Xs in a row. In the case where neither or both players win, output Indeterminate.

Input Specification

The first line contains an integer representing the size of the board, N (0 \le N \le 10^{5}).

The next line contains a string of length N which represents the game board.

Output Specification

Output a single string: Oscar Wins if Oscar wins, Xyla Wins if Xyla wins, and Indeterminate if both/neither win. Make sure your capitalization is correct!

Sample Input 1

10
XOXXOOOOXX

Sample Output 1

Oscar Wins

Sample Input 2

6
XXXOOO

Sample Output 2

Indeterminate

Comments

There are no comments at the moment.