Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hi,
It wasn't sarcastic at all as I was more interested in "how to do at with Streams at all" than "should it be done with streams?".
Basically I struggled with "how to apply Java 8" in this case, so that is why I liked your solution.
I honestly can't tell if that's sarcastic, but I hope it is. I used streaming to keep my streaming knowledge fresh, not because it's remotely a good idea for this problem (you'll notice there's 0 Best Practices votes, not even one from me). Mapping each individual value into its own stream is particularly painful.
And I bet the performance sucks, particularly because of
.mapToObj(IntStream::of)
.The real Java solution for this is a simple for loop with iterations equal to the length of the longer array.
Very elegant use of Java 8.