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
|
444 Discussions
|
Please Login in order to post a comment
The problem states that is will be a square grid of characters. However, one of the tests attempts to input a 3x4 grid.
JS/Javascript Solution, with 3 loops! Any improvement suggestions?
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