I’m very interested in the solution you come up wi...
# announcements
a
I’m very interested in the solution you come up with. I wrote some similar code recently to split a string into a sequence of substrings at undefined intervals but ended up getting rid of it because it was harder to understand than the imperative code I wrote to solve the problem. What I ended up doing was modeling my splitting logic as a sequence (a sequence that returned a random number), which I then processed via a custom
scan
function which emitted a running sum and the individual items. I consumed this using
takeUntil
, then I was left with a sequence of numbers which I could use to create substrings. Not sure this approach is quite applicable to your problem though.