Created
February 4, 2021 16:34
-
-
Save pedrofurla/aaf10de8981d7279e803a9f6864c183c to your computer and use it in GitHub Desktop.
Silly twitter challenge https://twitter.com/Al_Grigor/status/1357028887209902088
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foldr @[] ( | |
\elm -> \case | |
(k, i):rest -> if (elm == k) then (k,i+1):rest else (elm, 1):(k, i):rest | |
[] -> [(elm,1)] | |
) [] "aaaabbbcca" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment