Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Xs and Os Referee by wbl4126
from typing import List
def checkio(game_result: List[str]) -> str:
for s in ["X", "O"]:
ary = (
[gr.count(s) for gr in game_result]
+ [gr.count(s) for gr in zip(*game_result)]
+ [[game_result[0][0], game_result[1][1], game_result[2][2]].count(s)]
+ [[game_result[0][2], game_result[1][1], game_result[2][0]].count(s)]
)
if 3 in ary:
return s
return 'D'
March 10, 2020