You are viewing a single comment's thread. Return to all comments →
my solution in python3 .. might not be the fastest but passes all tests..
def gridChallenge(grid): rows = len(grid) cols = len(grid[0])
for i in range(rows): grid[i] = sorted(grid[i]) for j in range(cols): for i in range(rows-1): if grid[i][j] > grid[i+1][j]: 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 →
my solution in python3 .. might not be the fastest but passes all tests..
def gridChallenge(grid): rows = len(grid) cols = len(grid[0])