Sort the letters of string in alphabetical order: Difference between revisions

m
Line 127:
qSort
"Is this misspelling of alphabetical as alphabitical a joke ?"
 
 
qSort :: (Ord a) => [a] -> [a]
qSort [] = []
qSort (x : xs) = before <> (x : after)
where
before = qSort [c | c <- xs, c <= x]
after = qSort [c | c <- xs, c > x]</lang>
</lang>
{{Out}}
<pre>" ?Iaaaaaaaabbcceeefghhhiiiiiijkllllllmnoopppsssssttt"</pre>
9,655

edits