Grid Challenge Discussions | | HackerRank

Grid Challenge

  • + 0 comments

    Python

    def gridChallenge(grid):
        # Write your code here 
        result = ([sorted(subarr) for subarr in grid])
        if all(result[i][j] <= result[i + 1][j] for i in range(len(result) - 1) for j in range(len(result[0]))):
    
            return "YES"
    
        return "NO"