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
Javascript fails to run the tests
Test Results:
Solution
should test for something
Completed in 3ms
Any time you have
condition ? true : false
you can drop the ternary and just usecondition
for example your solution -- omitting the actual conditions --
const lovefunc = (flower1, flower2) => (condition1) || (condition2) ? true : false
becomes
const lovefunc = (flower1, flower2) => (condition1) || (condition2)
This comment is hidden because it contains spoiler information about the solution
if (condition) return true; else return false;
can always be rewritten as
return (condition);
...and usually doesn't even require the parentheses around the condition.
I don't understand this kata...
Is this saying the ATM contains bills (bank notes) in the denominations 10, 20, 50, 100, 200, 500 ?
(200 is unusual as a denomination)
I am given money? In (American) English this implies that I have this money, so the only sensible thing would be to deposit it in the ATM, but that's clearly not what the kata is about.
"repay" is definitely the wrong word to use here, as "repay" again implies that I have some money which I have to give to someone else (again, deposit in the ATM)
If this is in dollars it should mention dollars earlier.
If this kata is what I think it is (I haven't looked beyond the Description yet), this is about withdrawing money from the ATM. If that's the case I suggest rephrasing the problem more like the following:
Given an ATM which contains bills/notes in the denominations 10, 20, 50, 100, 200, and 500 dollars,
and assuming the ATM always has enough money to satisfy a withdrawal on any amount,
find the minimal number of notes/bills that must be dispensed to pay out a withdrawal of 'n' where 1<=n<=1500
• I saw a comment where there are test cases greather than 1500, so correct either the test cases or the problem statement
• Consider removing 200 from the denominations, as there is no such thing as a $200 bill; or make it in a fictional currency instead of dollars.