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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
When I sumbmitted my solution, the output gave me java.lang.ArithmeticException: integer overflow for a-test11. When I copied the test value into my clojure environment it ran and gave me a result with no errors.
How do I fix it if I can't duplicate the error on the server?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Agree with your point about floating point calculations missing 90 degrees. Judging from the test cases, which supplied floating point arguments, that could happen with any function that performs an equality check for exact values.
Fortunately, the test cases did not trigger such a scenario with my solution.
This was exactly what I needed; I had tunnel vision and needed your input to look at the problem from a slightly different angle. The tip on the proper method for the test object cleared up some confusion too.
Now I just need to work on the timing issue!
:-)
I'm asking why the test frame gives me different results from the unittest.
https://en.wikipedia.org/wiki/Fibonacci_number
Based on this information, the Fibonacci numbers for 0, -2, 6, and -6 are 0, -1, 8, and -8. These are the values I tested for and got using unittest. I copied the fib(n) def from my environment into the codewars environment.
Why does the test.expect call return failures when the values actually match?
(I got the (-96, -51680708854858323072) pair from running my algorithm against the submit function.)
This comment is hidden because it contains spoiler information about the solution
Please recheck this solution. Since xs is a reference to a list outside of the function, it has the side affect of modifying the data structure. That could be a nasty surprise to the user of this function. I believe a better solution is to run the sort on a copy of the list.