Grid Challenge Discussions | Algorithms | HackerRank

Grid Challenge

  • + 0 comments
    def gridChallenge(grid):
        import copy
        Grid = copy.deepcopy(grid)
        for i in range(len(Grid)):
            Grid[i] = sorted(list(Grid[i]))
        for row in zip(*Grid):
            if list(row) != sorted(row):
                return 'NO'
        return 'YES'