We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
`def gridChallenge(grid):
# Write your code here
fixed = list(map(lambda x: sorted(x), grid))
n = len(grid)
for index in range(len(grid[0])):
for i in range(n-1):
if (ord(fixed[i][index]) > ord(fixed[i+1][index])):
return "NO"
return "YES"
Cookie support is required to access HackerRank
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 →
`def gridChallenge(grid): # Write your code here fixed = list(map(lambda x: sorted(x), grid)) n = len(grid) for index in range(len(grid[0])): for i in range(n-1): if (ord(fixed[i][index]) > ord(fixed[i+1][index])): return "NO" return "YES"