You are viewing a single comment's thread. Return to all comments →
Javascript
function gridChallenge(grid: string[]): string { // Write your code here const sorted_grid = grid.map(row => Array.from(row).sort())
for(let j=0; j<sorted_grid.length; j++){ for(let i=0; i <sorted_grid.length-1; i++){ if (sorted_grid[i+1][j] < sorted_grid[i][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 →
Javascript
function gridChallenge(grid: string[]): string { // Write your code here const sorted_grid = grid.map(row => Array.from(row).sort())
}