title: Coin Change Algorithm JS
body: <p>I have been trying to come up with a solution for this algorithm for 3-4 days but nothing seems to work and the available solutions are a bit more advanced for me. It has to be solved with conditionals only so no recursion or dynamic programming. </p>
  
  <p>I need to determine the least amount of coins necessary to give change given the following denominations: 1, 0.5, 0.2, 0.1, 0.05, 0.02 and 0.01.</p>
  
  <p>Input is the following:</p>
  
  <p>Price of an item</p>
  
  <p>Sum paid by customer</p>
  
  <p>Current ideas:</p>
  
  <pre><code>let price = +gets();
  let paidSum = +gets();
  //gets is used to accept number input
  let change = paidSum - price;
  </code></pre>
  
  <p>I figured I could use Math.floor to isolate the integer part and subtract it but then I have no idea what to do with the remaining sum. </p>
  
  <p>Would modulo work to test whether the remaining sum contains any of the remaining values for change and then subtract again until I reach zero?</p>
  
  <p>I do realize this isn't the best formulated question but I am at a loss here and I've done every other task apart from this. Thanks.</p>