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.
defgridChallenge(grid:Array[String]):String={// Write your code herevalsortedGrid=grid.map(row=>row.sorted)valn=sortedGrid.lengthvalm=sortedGrid(0).lengthfor(col<-0untilm){for(row<-0untiln-1){if(sortedGrid(row)(col)>sortedGrid(row+1)(col)){return"NO"}}}"YES"}
Cookie support is required to access HackerRank
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 →
Scala Solution