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.
You cannot know every standard library function since birth. Going the long way, you not only learn for-loops and details about inner workings of stuff, but the 1-line solution usually also burns quite well into memory for next time. We all start without knowledge. So in my eyes you can call that 2 wins :)
Please dont threaten the poor stream. It is doing all it can already! Dont you see?
That is why we are here to learn =)
This comment is hidden because it contains spoiler information about the solution
I did not know that Java has functional patterns / iterators. Nice!
i am about half your age, so you may consider me a kid
all i wanna say is that it's not all about the big O; by saying that my solution is 10x faster i'm just giving an example of two O(n) implementations that are quite different
and if you don't get it, my first comment was a criticism of HotMugger's statements
Are you a kid? Are you trying to elicit a kid argument with "my solution is 10x faster. No, my solution is 100x faster. No, it's infinity faster. No, its infinity x infinity faster".
Grow up.
ChatGPT moment
not all O(n) are the same, coefficients vary. the term suboptimal applies well
my solution is about 10x faster than this one
This comment is hidden because it contains spoiler information about the solution
the pushes will just assign capacity to the next power of 2 when len is a power of 2. and there will be no moving of elements unless the next capacity is at least 2^16 or even higher
still, it would be best to use with_capacity and omit capacity checks
wdym consultant?
also sorry for the dead code and putting the main function at the very end
it wouldnt be complete without iterators :)
needs more iterators apparently
I found the consultant :)
risky :D
Loading more items...