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):rows=len(grid)long=len(grid[0])mx=[list(row)forrowingrid]# rearrange elements for rowsforidx,rowinenumerate(mx):mx[idx]=sorted(row)# check for columns orderforiinrange(long):checking=[]forrowinmx:checking.append(row[i])print(i,checking,sep=":")forjinrange(rows-1):ifchecking[j]>checking[j+1]:return'NO'return'YES'
Grid Challenge
You are viewing a single comment's thread. Return to all comments →
Python