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.
This kata has no random tests.
if I may answer... with the if-statement you can stop processing earlier when a field is zero. it would be wasted runtime to loop through the hole array, if the result would be zero anyway. this solution is nice for arrays with bigger size
the if loop seems redundant to me, bc result * 0 would make 0 anyways. or are there any other reasons you used this?
Really enjoyed (was frustrated by) this.
Learned about a few different sieves, and figured out how to fine tune the implementation to fit within the time limits.
Really liked this one. Thanks!
what happen to index 0? it will be alwayes 0
Actually IntStream.of() calls Arrays.stream()
From IntStream.java :
Just finished in Java.
Is this solution better than solution with Arrays.stream()?
Approved
Java translation here
im passing the basic tests but failing the randomTests
Nevermind, read it wrong
Javascript version here. This is not how one does weighted averages. You have to divide your sum by
n + 1
, notn
, as your boss counts twice (as if there were two of them).Approved, thanks
Loading more items...