sort the input array
for i in range ( n ) : NEW_LINE INDENT s = arr [ i ] NEW_LINE Len = len ( s ) NEW_LINE if ( count [ Len - 1 ] == 0 ) : NEW_LINE INDENT sortedArr [ Len - 1 ] = s NEW_LINE count [ Len - 1 ] = 1 NEW_LINE DEDENT elif ( sortedArr [ Len - 1 ] == s ) : NEW_LINE DEDENT