Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
XsandOsReferee.c solution in Clear category for Xs and Os Referee by trudnopodobny
from typing import List
def checkio(field: List[str]) -> str:
for row in field:
if row[0] == row[1] == row[2] and row[0] != ".":
return row[0]
rotated_field = zip(*field)
for row in rotated_field:
if row[0] == row[1] == row[2] and row[0] != ".":
return row[0]
if ((field[0][0] == field[1][1] == field[2][2]) or (field[0][2] == field[1][1] == field [2][0])) and field[1][1] != '.':
return field[1][1]
return "D"
Oct. 8, 2018
Comments: