diff --git a/kyu_5/tic_tac_toe_checker/checker.py b/kyu_5/tic_tac_toe_checker/checker.py index df7c94fceec..3cb71126682 100644 --- a/kyu_5/tic_tac_toe_checker/checker.py +++ b/kyu_5/tic_tac_toe_checker/checker.py @@ -87,7 +87,4 @@ def check_rows(board: list) -> int | None: :param board: list :return: 1, 2, or None """ - for row in board: - if len(set(row)) == 1: - return row[0] - return None + return next((row[0] for row in board if len(set(row)) == 1), None)