## PowerShell - 141 ## Reads text from a file named 'a'. $x=@{} gc a|%{[char[]]$_|group|%{$c=$_.name.tolower().trim() $n=$_.count;$x[$c]=($n,$x[$c])[$n-lt$x[$c]]}} ($x.Keys|sort|%{$_*$x[$_]})-join""