Sort the letters of string in alphabetical order: Difference between revisions
Content deleted Content added
m →case insensitive: use internal sort |
|||
Line 131:
qSort :: (Ord a) => [a] -> [a]
qSort [] = []
qSort (x : xs) = before <>
where
before = qSort [c | c <- xs, c <= x]
after = qSort [c | c <- xs, c > x]
</lang>
{{Out}}
<pre>" ?Iaaaaaaaabbcceeefghhhiiiiiijkllllllmnoopppsssssttt"</pre>
|