You are viewing a single comment's thread. Return to all comments →
def gridChallenge(grid): sorted_words = [''.join(sorted(word)) for word in grid] sorted_words = [''.join(word) for word in list(zip(*sorted_words))] for word in sorted_words: for i in range(len(word)-1): # print(word[i+1], word[i]) if word[i+1] >= word[i]: pass else: return 'NO' return 'YES'
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Grid Challenge
You are viewing a single comment's thread. Return to all comments →