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.
nice
you dont even need loops, arithmetic progression sum is (a1+an)*n/2. I guess that exercise is about learning synthax. Otherwise i would be able to do it in straightforward formula in excel without loops.
Much more elegant than my solution.
Nice, even if it appears having issues with cases in which one of the bounces isn't strictly > of window, like this:
assertEquals(1, BouncingBall.bouncingBall(2.0, 0.5, 1.0));
I guess you should start with i=3, because 0, 1, 2 does not satisfy this condition
so easy with your solution !
wth!!!!
This solution fails for 3 reasons:
Here is a version that works with my tests :
Code is as follows: https://www.codewars.com/kata/reviews/55472965761db2bab8000085/groups/623b5f73dff0240001526f40.
Tell me what you think.
Apparently in java8, ArrayList.addAll(null) returns stackoverflow !!
At some point one of the sqInRect will return null so the whole will fail
There is a ton of comments blaming recursion below. But let's stop for a second and look at the code ones again.
Two main drawbacks impact performance here:
This comment is hidden because it contains spoiler information about the solution
this is clearly the better contender for best practices imo
Recursion's solution is almost always worse than for-loop statement in efficiency. And every recursion can be replaced by for-loop, but sometimes it's really hard.
This comment is hidden because it contains spoiler information about the solution
Loading more items...