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
|
442 Discussions
|
Please Login in order to post a comment
Javascript
function gridChallenge(grid: string[]): string { // Write your code here const sorted_grid = grid.map(row => Array.from(row).sort())
}
The problem description incorrectly uses the term ascending. Ascending is not the same as non-decreasing.
Test case 12 is invalid. The documentation says that its a square grid, but test case 12 has a 3x4 and 4x3 grid as the 2nd and 3rd test case:
3 3 abc lmp qrt 3 mpxz abcd wlmf 4 abc hjk mpq rtv
Java 15 using streams, some utils and early return for NO result:
my solution in python3 .. might not be the fastest but passes all tests..
def gridChallenge(grid): rows = len(grid) cols = len(grid[0])