Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
list.extend solution in Clear category for Xs and Os Referee by sotirr
from typing import List
def checkio(game_result: List[str]) -> str:
diagonal1 = [game_result[0][0], game_result[1][1], game_result[2][2]]
diagonal2 = [game_result[0][2], game_result[1][1], game_result[2][0]]
columns = zip(*game_result)
game_result.extend([*columns, diagonal1, diagonal2])
result = [row[0] for row in game_result
if len(set(row)) == 1 and '.' not in row]
return result[0] if result else 'D'
Jan. 11, 2020
Comments: