You are viewing a single comment's thread. Return to all comments →
JavaScript
function gridChallenge(grid) { for (let i = 0; i < grid.length; i++) { grid[i] = grid[i].split("").sort().join(""); } for (let col = 0; col < grid.length; col++) { for (let row = 1; row < grid.length; row++) { if (grid[row - 1][col] > grid[row][col]) { 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