Ad
  • Default User Avatar

    You probably read the question wrong as I initially did. There are only 25, 50 and 100 dollar bills (no increments or sub-types). It took 1 for-loop and several conditionals to solve it. No other data structures, recursion or functions needed.

    If he made you track different payment amounts (given as nested arrays), evaluate whether or not the value was enough and then see if he could successfully get through the line (with multiple coin and dollar amounts), then it would definitely be a 5 kyu problem...

  • Custom User Avatar

    If it's easy that means it should be a higher kyu number.