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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Floating point error. Avoid floating point calculations whenever possible.
Replacing
Math.Pow(i, 3)
withi*i*i
works perfectly.This comment is hidden because it contains spoiler information about the solution
@CrazyMerlyn gave a way, thanks to him!
I just tried the C# version and it works fine, so there's probably something wrong with your code.
Could you post your code(mark it as spoiler)?
There is an easy way to fix this. Don't use recursion.
Try to think of an iterative approach. Shouldn't be too difficult since you have already solved it recursively.
In my solution I have 2 errors:
rndTest:
Expected: 54614
But was: -1
and Test11:
Expected: 55100
But was: -1
I don't understand what is wrong only on these tests.
Language c#