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.
I'm having the same issue, for some reason the console.log shows that [1, 2, 5] is being passed as the coinDenominations. Only when I console.log it with nothing else on the function does it show as [1,2,5,10,20,50]
thank you for your help!
You have no test failed because your code crashes on performance tests, and tests abort as soon as it happens. Read the log to the end:
hello, this is my first time encountering this one, what does it mean if i passed all the test cases and have 0 failed test but it is not letting me submit. I checked the result and saw that the performance test is still red, what does it mean? thank you in advance
Its in JavaScript
I have an issue... i run my code on RunJS and there all the test cases pass fine but when i copy the same code and run the test here not passes all of them and with a console.log i see that here it works really weird. How can i do to solve this?
Here in this test case: coinsNeeded(123,[1,2,5,10,20,50]) the console.log shows me that only uses to reduce the amount by 5...
but in my RunJS its reduced properly as shown in the sample test (50+50+20+2+1). I will copy my code here for you to test it in diferrent places but idk if its correct doing that here. So i wait for a response to try to solve my problem. Thank you and have a good day
( JS )
Example tests:
it("123 is 25+25+25+25+10+10+1+1", () => {
is missing one+ 1
.There may be more.
voile thanks for your help <3 <3 <3
In fact this is kind of a duplicate, so, better to retire it probably?
The task stated by the kata is
It didn't tell us to calculate the amount of coins as determined by a greedy algorithm. In fact both are incompatible, since a greedy algorithm is not a correct algorithm. So the description at it is right now is unacceptable.
Well, I guess the description is poorly written.
Since this:
contradicts that.
I guess the fix is either to change the description or rewrite the tests and reference solution...
It depends on what "solvable" means.
Now because the description is still full of issues, it's like that right now. The whole description needs to be revamped, actually.
Isn't this just an inherent attribute of greedy algorithms? It seems like the point of the kata is to practice greedy algorithms, not necessarily to find a guaranteed optimal algorithm.
The tests don't have such cases as your example for a reason, no?
The kata only guarantees that "all amounts given will be solvable" and "a greedy algorithm should be used", but does not guarantee that the solution can be reached via a greedy algorithm, e.g:
9
and[5,3]
.Loading more items...