You are viewing a single comment's thread. Return to all comments →
Python solution
def gridChallenge(grid): sorted_grid = ["".join(sorted(row)) for row in grid] num_cols = len(sorted_grid[0]) num_rows = len(sorted_grid) for col_idx in range(num_cols): columns = [] for row_idx in range(num_rows): columns.append(sorted_grid[row_idx][col_idx]) if columns != sorted(columns): return "NO" 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 solution