If Stream Gatherers improve the solutions to your Advent of Code assignments please let me know π #java #streams #AdventOfCode
1 repost8 likes
If Stream Gatherers improve the solutions to your Advent of Code assignments please let me know π #java #streams #AdventOfCode
1 repost8 likes
Wrote my own mapWithIndex to improve Day 4 (github.com/mvitz/advent...) but wasn't exactly sure how to write a correct flatMapWithIndex.
To avoid the flatMap(identity) I guess you could do something akin to: gather(mapWithIndex(Pair::of)) .flatMap(p -> Arrays.stream(p.right().split(ββ)).gather(mapWithIndex((x, value) -> Pair.of(x, p.left()))).collect(β¦)