Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Rows and columns solution in Clear category for Xs and Os Referee by PyPoet
def checkio(input):
for row in input:
if row[0] == row[1] == row[2] != '.':
return row[0]
for column in range(3):
if input[0][column] == input[1][column] == input[2][column] != '.':
return input[0][column]
if input[1][1].isalpha():
if input[0][0] == input[1][1] == input[2][2]:
return input[0][0]
elif input[0][2] == input[1][1] == input[2][0]:
return input[0][2]
return "D"
Sept. 13, 2015