Sort the substrings in given string by number of character in them in incremental order