Ad
  • Default User Avatar

    Completely stumped. I've passed most of the tests, except ones like this one.
    Why would the expected value be 0? After removing non-integers, odd numbers and then empty arrays, the array will be [25,13,17,43,9,15,36,18], which will not return an empty array.

    let a = [
    [4, 3, 7, 8, 9, 2, 1, 5, 'c'],
    [6, 5, 6, 1, 'v', 1, 0, 5, 1],
    [4, 4, 'c', 7, 6, 6, 3, 6, 7],
    [1, 7, 7, 'l', 5, 8, 9, 5, 9],
    [0, 't', 8, 2, 8, 9, 0, 8, 0],
    [4, 6, 2, 6, 'o', 8, 4, 2, 4],
    [3, 6, 9, 2, 0, 8, 2, 3, 'u'],
    [9, 3, 1, 9, 4, 4, 'u', 7, 7],
    [0, 'n', 9, 0, 0, 0, 9, 2, 2]
    ]
    Test.assertEquals(kiyoLcm(a), 0);

  • Default User Avatar

    An issue perhaps:
    coins in the vending machine = { '1': NaN, '4': NaN, '10': 3, '20': 2, '50': 5, '100': 4, '200': 3, '50': 5, '100': 4, '200': 3}
    credit = { '50': 1}
    price = 10
    change needed = 40

    expected { '10': 3 }, instead got {'20': 2} -> But isn't {'20': 2} the a better result?

    Also, please clarify how '4' and '1' are not valid coins.
    It looks like coins of '4' and '1' denomination seem to be in the machine and the machine can return them as change.
    Does this mean the machine has coins of '4' and '1' denomination, but it cannot recieve these coins as credit?