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.
Yes, that's correct and certainly a bug. In extreme cases it might even turn a terminating computation into non-terminating. Annoying n-plus-a-half loop strikes again. Easy to fix, but turns the code into a mess anyway. :)
Great solution!
But I think, it has one sneaky problem.
Your
takeS
will actually compute one more element than needed. This might be a problem, i.e. if the stream is exausted.