You are viewing a single comment's thread. Return to all comments →
Python 3 solution:
from typing import Literal def gridChallenge(grid: list[str]) -> Literal["NO", "YES"]: _grid = iter(grid) last_row = sorted(next(_grid)) for row in _grid: row = sorted(row) if any(i < j for i, j in zip(row, last_row)): return "NO" last_row = row return "YES"
Seems like cookies are disabled on this browser, please enable them to open this website
Grid Challenge
You are viewing a single comment's thread. Return to all comments →
Python 3 solution: