Ad
  • Custom User Avatar

    exactly ! expect(powerOf4(20), false) should be included in tests

  • Custom User Avatar

    your solution is wrong
    powerOf4(20) returns true which is wrong

  • Custom User Avatar

    You are right. There was a mistake in the description. Now It is changed to:

    The vending method receives the item price and the coins used to buy it and returns the change out using the the max value coins (for example, return {6:1, 2:1} is preferred over {4:2}).

  • Custom User Avatar

    Hi!
    Why there is test Test.assertSimilar(vm.vending(12, {4:5}), {2:1, 6:1}); expecting to return {2:1, 6:1} ? Vm can accept minimun required 3 coins of value 4 and return 2 unused. So total number of change out coins is equal 2 in both cases