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.
Synchronized is redundant, commited my mistake.
It's about 30% slower than non-synchronized version.
Thanks, put
Test.assertEquals()
inside a condition, works fine.If I put
Test.assertEquals()
put inside a condition I getMax Buffer Size Reached
Test.assertEquals() will output a billion messages affecting time of execution
Added random tests
Your solution is just a little bit slower than the fastest one, so it should pass.
Thanks for your feedback, indeed these restrictions are redundant, removed them.
Thanks for the feedback, it seems there are no ways to implement fast working solution for such big numbers.
I added required range of input numbers to the description.
It seems numWays method is broken in random tests. I tried a few working solutions from similar kata https://www.codewars.com/kata/counting-change-combinations/ and they all fail on some random tests here.
For example:
cents = new Currency([ 145, 27, 11, 9, 1 ]);
Test.assertEquals(cents.numWays(195), 676, "random test did't accept 676 here");
Very elegant solution, but it can cause stackoverflow with long lists.