+ 2
Count the frequency of letters in string and arrange them into acceding order.
use any language that is comfortable for you. eg:- string is: hey there frequency: e-3 h-2 y-1 t-1 r-1 new ordered string: eeehhrty
1 Antwort
+ 2
Haskell:
main = print . reverse . concat . sortBy (comparing length) . group . sort $ "hey there"
https://tio.run/##TYs7CsMwEAV7neJhXNiNb5DGpDT4DIuySCL6sdoEfHpFgRTpHvNmPLUnx9h7SLWI4k5K2xGamn9wysOYRCHjhiohKzYIv1kaj2VLtvRFbQT7hcWWVGloDpGzU7@Oz0l51Z@DGZPnC@pZeOr9Aw