get first element
while ( count [ index ] == 0 ) : NEW_LINE INDENT index += 1 NEW_LINE DEDENT prev = index NEW_LINE prevString = sortedArr [ prev ] NEW_LINE index += 1 NEW_LINE while index < maxLen : NEW_LINE INDENT if ( count [ index ] != 0 ) : NEW_LINE INDENT current = sortedArr [ index ] NEW_LINE if ( prevString in current ) : NEW_LINE INDENT prev = index NEW_LINE prevString = current NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Cannot ▁ be ▁ sorted " ) NEW_LINE return NEW_LINE DEDENT DEDENT index += 1 NEW_LINE DEDENT