4 ms·
My own first idea was actually similar to yours, although I wrote: map (head &&& length) . group (Also, it took me only a few seconds, because it just seeme
by zzo38computer 6y ago
My own first idea was actually similar to yours, although I wrote:
map (head &&& length) . group
(Also, it took me only a few seconds, because it just seemed obvious to me, even though Haskell is not the programming language I normally use for my projects, but it seems the right thing for this.)
- deleted 6y ago[deleted]
- hyperrealgopher 6y agoHa, what a coincidence! Right before you posted this I just remembered (&&&) exists: https://gist.github.com/hyperrealgopher/19730725804ba8825d50d96f75b88a96/revisions https://gist.github.com/hyperrealgopher/19730725804ba8825d50... Thanks for sharing!