Ad
  • Default User Avatar

    i rewrote the description a bit, hopefully it makes more sense

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Javascript fails to run the tests

    Test Results:
    Solution
    should test for something
    Completed in 3ms

  • Custom User Avatar

    Any time you have condition ? true : false you can drop the ternary and just use condition
    for example your solution -- omitting the actual conditions --
    const lovefunc = (flower1, flower2) => (condition1) || (condition2) ? true : false
    becomes
    const lovefunc = (flower1, flower2) => (condition1) || (condition2)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    How is 200 an unusual denomination?

    Okay, now I see it explicitly mentions 200 dollar bills. Sorry for the noise.

  • Custom User Avatar

    The following isn't true

    and assuming the ATM always has enough money to satisfy a withdrawal on any amount

    Because you forgot this part:

    or output -1 if it is impossible.

    About your last two points:

    I saw a comment where there are test cases greather than 1500, so correct either the test cases or the problem statement

    Removed some sample tests in a couple languages where n was 5000, the final tests seemed ok.

    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.

    You could use Argentine Peso, we have all those notes/bills, including the 200 one.

    The kata's author seems active, so I'll let him handle the description changes.

  • Custom User Avatar

    I don't understand this kata...

    There is enough money available on ATM in nominal value 10, 20, 50, 100, 200 and 500 dollars

    Is this saying the ATM contains bills (bank notes) in the denominations 10, 20, 50, 100, 200, 500 ?
    (200 is unusual as a denomination)

    You are given money in nominal value of n with 1<=n<=1500

    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.

    Try to find minimal number of notes that must be used to repay in dollars

    "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.