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.
- Grid Challenge
- Discussions
Grid Challenge
Grid Challenge
Sort by
recency
|
87 Discussions
|
Please Login in order to post a comment
n clearly does not contain the number of row and columns in the grid, as the number of rows and columns can be different
Python 3 solution:
Although it says it receives a square matrix, it doesn't. Code should work even when the grid is not square.
My Python solution given the fact that some test cases come with non-square grids
`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"