You are viewing a single comment's thread. Return to all comments →
There's itertools.groupby() in Python, which would solve this problem with ease.
itertools.groupby()
Unfortunately, the group-by in Racket has different semantics.
group-by
However, there's an elegant solution possible involving regexes.
Seems like cookies are disabled on this browser, please enable them to open this website
String Compression
You are viewing a single comment's thread. Return to all comments →
There's
itertools.groupby()
in Python, which would solve this problem with ease.Unfortunately, the
group-by
in Racket has different semantics.However, there's an elegant solution possible involving regexes.