Sort the letters of string in alphabetical order: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add CLU) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 14: | Line 14: | ||
Write the function even if your language has a built-in function for it. |
Write the function even if your language has a built-in function for it. |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
<lang 11l>F sorted_str(s) |
|||
DefaultDict[Char, Int] d |
|||
L(c) s |
|||
d[c]++ |
|||
V r = ‘’ |
|||
L(k) sorted(d.keys()) |
|||
r ‘’= k * d[k] |
|||
R r |
|||
print(sorted_str(‘The quick brown fox jumps over the lazy dog, apparently’)) |
|||
print(sorted_str(‘Is this misspelling of alphabetical as alphabitical a joke ?’))</lang> |
|||
{{out}} |
|||
<pre> |
|||
,Taaabcdeeeefghhijkllmnnoooopppqrrrsttuuvwxyyz |
|||
?Iaaaaaaaabbcceeefghhhiiiiiijkllllllmnoopppsssssttt |
|||
</pre> |
|||
=={{header|Action!}}== |
=={{header|Action!}}== |