title: Find minimum number of currency notes and values that sum to given amount array issue
body: <p>when I try get this value 2316 its return [0,2,0,3,0,0,2,1,0,1] but I need get this out put [0,2,0,3,0,0,1,1,0,1] I think something wrong with my algorithm.</p>
  
  <pre><code>function findNoteAndCoins(salary) {
    var note = [5000,1000,500,100,50,20,10,5,2,1];
    var noteCount = new Array(10);
    noteCount = Array.from(noteCount, item =&gt; item || 0);
  
      for(var i = 0; i &lt; 10; i++){
          if (salary &gt;= note[i]){
              noteCount[i]= salary / note[i];
              salary = salary % note[i];
          }
      }
  
     for(var j = 0; j &lt; 10; j++){
          if (noteCount[j] != 0){
              var count = noteCount[j];
          }
      }
  
    return noteCount.map(num =&gt; (num * 1).toFixed(0));  
  }
  
  findNoteAndCoins(2316);
  </code></pre>