Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First Solution solution in Clear category for Xs and Os Referee by UriyaBA
from typing import List
def checkio(game_result: List[str]) -> str:
X = [game_result[0], game_result[1], game_result[2], # Horizontal rows
# Vertical rows
game_result[0][0]+game_result[1][0]+game_result[2][0],
game_result[0][1]+game_result[1][1]+game_result[2][1],
game_result[0][2]+game_result[1][2]+game_result[2][2],
# Diagonal rows
game_result[0][0]+game_result[1][1]+game_result[2][2],
game_result[0][2]+game_result[1][1]+game_result[2][0]
]
if 'XXX' in X:
return 'X'
if 'OOO' in X:
return 'O'
return 'D'
Aug. 14, 2021
Comments: