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.
Closed.
You should avoid converting number to string many times.
See https://en.wikipedia.org/wiki/Fibonacci_number#Negafibonacci for an explanation of Fibonacci numbers for negative numbers.
And make sure that you compute the power correctly: put parenthesis around the
-1
, like in(-1) ** ((n.abs)+1) * fib(n.abs) if n < 0
This comment is hidden because it contains spoiler information about the solution
This is expected.
same here, as ex:
fib -38
Test Passed: Value == -39088169
fib -25
Expected: 75025, instead got: -75025
fib -88
Test Passed: Value == -1100087778366101931
I just solved the C# version. Issue seems solved.
Looks like a error in the some test cases : while n is negative - expected result is positive number for some test case
Ex:fib(-6) expected 8
There was an unused var on the backend test. I removed it, could you see if it solved the issue?
I removed the unused var. Might work now.
He defines a Random variable which is never used inside his submit-testcases "private Random random = new Random();" and since CW throws warnings, all these katas with unused variables will not work (or other warnings too - it's not really an internal error, only a compiler warning)... Here the example tests work, because there are only static tests without unused variables;-)...
C# solution the same thing, as below :
Compilation succeeded - 1 warning(s)
{"stdout":"","stderr":"/tmp/csharp11653-23-v5rpbw/fixture.cs(8,20): warning CS0414: The private field `KataSolution.random' is assigned but its value is never used\n","wallTime":0}
Can you explain me why the warning interrupts the compilation? I how i can fix this?