You are viewing a single comment's thread. Return to all comments →
JS:
function gridChallenge(grid) { const newGrid = []; grid.forEach((row) => { newGrid.push(row.split('').sort()); }); for (var i = 0; i < newGrid[0].length; i++) { for (var j = 0; j < newGrid.length - 1; j++) { if (newGrid[j][i].charCodeAt(0) > newGrid[j+1][i].charCodeAt(0)) 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 →
JS: