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.
There is 1 way to get 0, and that is by having 0 coins.
Sorry @trashy_incel, this was the first time I opened an issue and I was running crazy and did not found out exactly what was happening. It seamed that for some reason, something was being cached from test to test, even though everything was instantiated inside the function, so the submit test set was giving different results on some tests. Most likely something on my side, but running out of options, decided to open an issue. I'll remember to post more information next time, and to come back after completion (after getting all tests to pass, I stumbled upon timeout, so had to rethink on a faster solution)
The "Attempt" tests set are giving awkward results.
I tried copying one failing test to the "Test" set, and it gives the correct result there !
I tried copying the algorithm and the input to Python Tutor, and it also works correctly giving the correct result !
I have no idea why the attempt set is giving different results.
There is one way to make change for
0
, which is to give back0
.4th test, why on earth is it 1 and not 0?
count_change(0, [1,2]) # => 1
Am I missing something?
This comment is hidden because it contains spoiler information about the solution
The tests should be changed and/or lessened, or the recursion tag should be removed from the question.
I timed out the first time I tried a recursive solution in python and the second time I got an error because I exceeded the maximum recursion depth (the money was over 5000 and there was a coin with value 1).
Tried solving this kata in c++
I got 4 different solutions working but none were fast enough
The discription does not mention any speed requirement so running into a "your code ran for to long" after every time i was able to finish a new version of my algoritm was super demoralizying since each did logically work.
Please update the description of this test to mention the speed requirement, or just reduce the amount of tests in the c++ code challange.
Side note, solutions that work for other languages dont for c++ due to this speed requirement.
This kata is about 5 kyu in my opnion
im late, but nice!
CoffeeScript fork
Adds random tests and switches assertions to chai.
The kata needs random tests.
The kata design should follow proper coding practice. It should either be
new Condorcet(votes1).winner()
, or (more appropriately) justcondorcetWinner(votes1)
, since there is no need to put a class around a stateless function.Condorcet(votes1).winner()
is not a valid design.Loading more items...