You are viewing a single comment's thread. Return to all comments →
TS or JS solution
function gridChallenge(grid: string[]): string { let newG = grid.map((g) => { return g.split("").sort() }) let row = newG.length let col = newG[0].length for (let i = 0; i < col; i++) { for (let j = 1; j < row; j++) { if (newG[j -1 ][i] > newG[j][i]) { 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 →
TS or JS solution