tip jar softkeks

JavaScript performance comparison

Test case created by dreszczyk

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  const coinList = [5,10,10,10,2,20,10,1,50,50,5,10,2,1,50,10,10,10,5,10,50,1,1,1,1,10,50,50,1,2,20,20,10,20,50,2,1,50,50,5,20,2,50,10,50,10,5,1,20,2,5,1,1,5,50,20,2,5,2,20,5,20,2,2,5,5,1,5,10,2,50,5,2,2,50,50,10,50,2,2,1,20,1,50,2,10,10,20,5,50,1,10,50,2,20,10,2,10,50,10,2,2,10,2,1,1,10,2,20,5,2,20,1,20,20,5,5,1,10,50,1,5,50,10,2,1,5,20,20,2,50,20,10,10,50,1,50,50,2,10,1,20,20,2,5,5,20,2,1,20,5,10,2,50,5,5,20,1,1,20,5,5,50,1,50,20,20,50,20,10,2,2,5,2,2,10,10,10,1,5,10,10,5,5,10,10,50,5,1,10,2,10,50,2,50,1,50,1,20,10,5,10,50,50,5,5,1,10,5,50,2,20,10,2,20,1,10,1,1,10,50,5,20,2,20,5,20,20,10,5,5,50,5,10,5,50,5,5,50,2,50,2,5,2,5,10,2,2,2,1,10,10,20,2,10,20,20,50,50,20,5,10,5,50,50,2,1,5,2,10,10,50,50,5,50,1,50,20,20,20,20,5,10,1,2,20,50,10,50,50,5,50,1,2,5,50,20,20,50,10,50,50,20,50,1,20,10,20,10,1,2,1,10,50,20,1,1,50,5,20,1,1,20,10,1,50,10,10,10,2,20,20,20,1,1,1,2,20,10,20,5,50,5,1,10,10,10,10,20,10,10,50,20,5,2,5,10,1,10,1,10,10,5,5,10,20,50,10,50,10,5,20,2,10,2,2,1,5,20,20,5,5,50,10,5,20,20,20,2,10,50,2,10,50,1,5,10,50,2,5,50,10,5,2,50,50,10,5,50,1,10,10,1,10,50,20,1,5,5,10,20,50,1,2,50,2,10,50,10,10,5,50,2,50,20,10,50,5,2,10,1,10,20,2,1,50,10,2,5,20,10,5,10,10,2,50,20,1,1,50,10,10,10,1,10,20,20,5,50,2,1,50,5,2,20,50,20,1,20,5,1,10,5,1,5,2,5,10,20,20,50,50,5,1,10,20,10,5,2,2,20,20,10,50,1,20,10,5,1,5,2,1,10,1,20,50,10,10,5,20,2,1,2,10,10,5,10,50,50,1,50,2,20,1,10,1,2,5,2,10,5,20,2,20,20,2,20,20,2,10,5,10,10,1,20,20,1,1,50,10,5,5,10,20,2,50,20,2,10,1,2,50,2,2,10,20,2,5,50,20,5,2,20,5,2,20,10,2,10,1,10,5,5,1,20,50,20,50,2,5,1,50,2,5,10,50,50,1,2,2,1,2,1,10,2,2,2,20,50,5,10,10,5,10,20,2,10,2,50,50,20,50,20,50,5,2,10,10,1,10,50,5,1,10,20,50,2,5,50,2,10,20,2,2,2,2,10,20,5,5,20,10,5,1,50,2,5,5,1,1,50,20,20,2,2,1,50,1,10,2,10,20,5,5,20,5,1,50,10,1,1,10,1,2,2,1,50,1,5,1,10,5,50,20,5,2,20,2,5,2,50,1,10,1,5,2,20,10,50,50,1,50,5,10,5,50,50,1,5,5,50,1,2,5,50,10,20,20,50,50,10,2,10,5,10,20,20,50,50,50,50,2,5,5,20,50,10,2,1,10,5,1,20,10,2,20,20,50,50,10,1,10,20,50,20,20,10,5,50,1,10,20,10,20,10,5,50,2,20,5,10,1,10,2,2,20,1,10,5,2,5,20,20,5,20,10,50,5,2,20,10,5,10,10,20,20,50,5,20,5,20,5,1,2,2,20,10,20,1,1,50,50,1,5,2,1,20,50,20,50,5,50,2,2,1,20,50,50,2,20,5,10,10,20,1,1,10,50,5,5,1,1,20,2,20,5,50,20,1,1,10,1,20,20,50,2,50,1,1,2,2,10,20,50,50,10,20,2,1,1,20,20,2,1,5,50,1,50,20,50,5,5,5,10,2,10,5,2,20,1,20,2,2,1,10,5,5,2,1,10,5,1,2,10,10,50,20,5,10,5,10,1,2,20,50,2,5,20,50,50,2,1,5,1,20,2,20,5,20,2,2,20,10,10,1,2,10,1,50,10,5,1,5,10,2,1,50,5,50,2,20,1,10,1,1,50,20,5,10,10,2,50,10,20,10,5,2,50,1,2,20,10,20,50,1,5,5,50,50,5,1,5,50,10,1,1,1,10,5,50,1,1,20,2,2,50,2,20,1,50,20,10,10,5,10,50,5,50,2,50,10,20,10,1,5,10,5,5,50,1,1,20,5,50,1,20,50,2,2,50,5,1,1,50,10,10,20,2,1,1,50,2,50,20,1,5,20,50,1,2,10,50,5,20,5,20,5,20,50,20,10,50,5,5,50,20,10,50,10,10,50,10,5,2,10,20,10,5,5,5,50,5,20,5,50,10,1,2,10,50,10,1,1,20,1,1,50,2,20,5,20,20,5,50,20,10,20,5,2,2,5,10,1,1,50,50,2,20,5,50,5,2,10,1,2,5,10,10,2,50,2,20,5,10,10,2,10,20,50,1,2,50,2,10,2,20,20,10,50,1,5,10,2,1,10,1,20,1,50,20,20,5,1,20,2,50,50,1,5,1,50,20,20,10,2,10,1,50,10,10,5,50,1,10,20,50,20,5,5,5,50,10,20,50,50,20,10,1,5,2,20,1,10,1,2,1,10,20,20,5,5,10,5,5,1,50,1,10,2,10,1,20,2,20,10,2,50,1,20,50,2,20,1,1,10,2,2,5,2,10,2,50,50,10,50,10,1,5,1,1,1,50,20,5,2,50,1,20,2,20,20,20,20,20,20,1,5,2,1,50,5,20,50,20,10,10,5,1,2,2,2,2,20,2,20,10,20,20,10,10,20,50,10,1,20,10,1,2,10,50,2,10,5,2,1,5,20,10,1,50,50,1,20,1,1,50,50,10,1,10,50,5,5,20,2,5,50,50,10,50,50,10,5,1,50,2,5,50,50,5,2,50,50,50,5,5,1,2,5,1,2,50,5,2,10,5,5,2,5,5,2,50,1,2,50,5,10,10,50,20,50,50,10,20,1,10,5,1,20,50,20,10,10,50,20,5,2,20,5,10,20,20,1,2,50,5,10,5,5,20,50,10,5,5,20,1,10,5,20,10,10,20,2,20,2,10,10,2,5,10,2,20,2,2,10,50,20,2,10,2,10,1,5,20,2,10,2,10,50,1,10,1,1,1,2,10,5,20,5,50,5,1,2,2,10,5,5,50,20,2,10,1,50,1,1,50,1,5,2,5,5,10,2,5,1,50,50,20,2,50,10,50,1,1,20,10,2,5,5,2,20,20,10,5,20,1,20,5,1,2,1,1,10,5,20,1,10,2,50,50,10,10,10,2,10,10,1,20,20,2,50,10,2,1,20,1,2,1,50,5,1,2,50,5,50,20,10,2,50,50,50,10,1,5,50,1,2,20,2,20,1,20,10,5,1,50,1,50,20,20,5,1,50,5,2,50,5,50,10,1,50,10,2,50,2,1,1,20,20,10,1,2,50,20,5,1,2,20,10,1,1,1,50,20,1,5,1,10,1,50,10,2,20,10,50,1,20,1,5,2,5,2,5,10,2,50,10,10,5,10,20,20,10,10,2,5,20,5,10,10,20,20,10,20,20,50,2,1,20,10,5,50,50,1,5,10,5,20,10,1,2,1,1,1,20,50,10,50,2,20,2,50,10,1,5,2,10,10,20,10,2,50,50,5,2,5,5,10,50,20,5,10,20,1,50,10,20,1,5,10,20,5,10,2,50,1,50,50,50,50,50,10,20,2,1,20,5,50,5,50,50,10,2,20,1,5,1,5,20,5,2,5,1,5,1,10,20,10,50,5,5,5,10,50,20,20,10,2,10,50,50,1,50,20,20,1,2,10,2,20,1,2,50,50,10,50,20,2,2,20,50,5,2,20,50,2,50,2,1,5,10,1,2,1,1,5,20,5,1,2,5,1,1,1,2,1,2,20,5,5,50,20,1,10,1,50,10,5,20,50,10,2,2,50,50,2,2,5,50,20,1,20,5,1,5,1,50,2,10,20,1,20,5,1,50,10,50,2,10,5,1,20,5,1,50,2,2,20,20,10,2,1,20,2,1,10,50,1,5,2,5,50,10,10,2,2,1,20,10,10,20,10,10,5,2,20,10,5,10,5,2,2,5,2,20,1,5,5,5,5,5,50,50,2,50,20,20,20,5,5,20,1,1,2,10,10,1,2,20,50,1,5,2,2,5,10,5,10,1,50,20,20,20,10,10,20,10,20,5,20,10,20,1,5,2,10,20,2,2,2,20,1,5,1,20,5,50,50,20,20,20,50,10,5,1,1,20,20,10,50,2,10,2,20,20,10,10,2,2,10,5,50,10,50,50,1,10,5,10,50,10,1,5,10,5,20,50,50,50,1,1,50,1,2,50,2,20,10,1,10,2,1,2,5,50,2,20,20,5,5,5,10,20,5,50,50,50,2,1,20,5,10,20,2,2,50,10,20,2,50,10,20,2,20,2,5,10,2,50,50,5,50,10,2,20,2,1,10,20,1,20,10,5,1,5,10,10,2,50,10,5,5,5,10,2,1,5,50,10,20,2,2,20,5,5,10,20,2,20,50,10,10,1,1,5,10,50,50,20,5,2,10,5,1,10,20,10,1,2,2,10,10,1,5,50,5,50,5,5,50,20,20,50,5,1,20,20,5,5,20,10,20,10,2,2,5,2,10,20,20,5,10,2,1,50,20,20,10,2,50,5,1,20,2,10,20,2,20,2,5,10,5,10,20,1,20,5,50,2,1,10,5,1,10,20,50,2,20,5,2,50,5,50,10,10,20,5,1,5,5,10,10,5,20,1,2,5,50,50,50,50,1,2,20,2,5,5,20,5,1,20,20,5,10,20,2,50,1,1,20,50,2,2,50,5,20,5,5,50,2,2,10,5,5,10,10,1,50,20,10,2,5,2,2,2,1,2,10,2,50,10,5,10,5,10,1,20,50,50,20,1,1,20,2,5,10,2,2,50,1,10,1,5,5,5,1,50,2,2,10,10,10,20,5,2,5,50,20,50,5,1,5,10,1,2,1,50,2,2,5,10,1,5,5,10,5,50,2,2,1,5,2,10,1,10,10,20,50,20,10,5,1,20,10,50,2,20,10,50,5,1,10,2,50,20,2,1,2,2,50,20,5,20,10,2,20,50,2,5,5,10,1,1,20,50,5,5,5,1,50,1,1,20,5,1,5,5,50,2,1,5,50,1,50,20,50,10,50,10,5,1,2,20,50,50,5,1,10,10,20,5,1,50,5,2,5,10,50,50,5,50,5,50,2,10,2,20,2,10,20,1,50,1,5,2,10,10,10,2,20,10,10,50,10,5,50,10,50,50,1,50,2,1,1,5,1,10,2,1,50,2,20,5,10,20,50,1,10,2,20,50,50,5,20,50,50,5,20,2,20,50,1,2,20,1,5,10,50,1,20,20,20,2,50,1,10,50,50,2,50,1,5,1,10,2,20,5,50,50,2,10,2,50,20,50,2,10,10,1,20,5,50,20,5,20,5,5,50,20,20,5,1,10,1,10,20,5,10,5,20,2,5,20,20,1,10,10,2,5,5,50,2,5,2,50,20,10,10,10,50,20,5,1,2,20,50,1,10,2,2,20,10,20,20,20,20,1,2,5,1,20,2,20,5,10,20,5,50,10,1,5,20,50,5,50,20,2,1,20,20,5,10,50,10,1,1,1,2,2,10,5,20,20,10,50,1,50,20,20,10,10,1,5,5,1,20,1,10,1,2,10,5,5,50,2,5,20,1,2,20,2,5,1,5,10,20,50,10,2,2,1,20,2,1,20,5,2,50,10,5,5,1,20,5,5,50,50,50,1,20,10,20,1,20,5,20,5,1,1,50,50,5,20,50,50,1,10,2,10,20,10,20,10,5,1,1,1,1,5,2,1,2,50,10,20,2,20,2,20,1,10,5,5,1,1,10,5,2,20,2,5,5,50,2,2,50,50,5,10,10,50,1,2,50,20,5,50,5,5,50,2,20,20,10,10,2,1,5,2,50,10,10,1,5,50,10,2,10,20,50,20,2,5,20,20,2,1,20,5,50,2,5,10,1,20,1,20,50,1,1,1,1,5,1,2,10,5,5,5,50,2,20,50,50,5,1,5,5,50,2,20,10,5,50,20,50,5,1,1,5,10,1,50,50,20,20,50,20,50,1,5,50,5,20,20,20,50,20,2,1,5,50,5,20,50,2,50,2,5,5,50,1,2,20,20,50,10,1,10,20,5,50,1,10,20,2,10,1,5,20,10,5,5,2,20,50,20,10,2,1,10,20,20,5,10,10,5,10,5,50,20,2,1,10,50,10,1,5,20,20,20,5,20,10,5,10,2,1,5,20,50,50,50,50,1,5,20,1,20,1,1,10,2,1,20,2,20,1,20,2,10,5,2,5,5,20,2,5,50,10,2,2,20,2,50,10,20,5,20,1,20,50,5,5,5,20,1,2,1,2,5,5,20,20,20,5,10,1,5,50,20,10,50,50,5,2,2,50,1,20,20,10,50,1,50,2,2,10,10,2,1,1,50,1,1,5,5,2,5,2,2,5,20,2,50,5,10,5,2,5,5,2,2,5,2,50,5,2,5,2,20,2,1,2,50,2,50,10,2,2,50,1,1,2,50,10,20,2,5,5,20,10,10,10,20,2,10,5,2,5,50,5,1,1,5,10,2,5,2,1,50,1,50,20,1,5,10,5,5,2,5,1,5,2,20,2,2,2,20,10,10,10,2,50,10,20,5,10,50,1,2,20,2,5,1,1,50,50,5,20,5,1,5,50,20,50,1,2,50,10,50,20,10,50,1,50,50,5,10,50,10,50,2,2,2,2,10,20,20,5,50,20,1,2,10,1,50,20,1,20,2,1,5,20,1,1,5,5,10,20,50,10,1,5,1,20,10,1,50,20,20,1,20,5,50,5,20,50,50,20,2,5,10,1,1,1,20,1,2,20,2,10,2,1,50,2,10,20,1,1,5,2,1,2,5,2,20,2,10,20,10,2,10,10,1,5,10,10,20,20,20,10,50,1,20,20,5,2,10,5,50,2,5,50,20,5,5,1,1,2,20,10,50,20,20,5,10,1,20,1,1,5,10,50,5,5,20,1,10,2,50,5,10,2,20,20,2,5,5,20,1,5,5,5,10,2,50,10,50,50,2,5,5,20,10,50,50,10,10,10,5,10,1,10,50,2,20,50,20,50,1,5,20,1,10,50,20,50,1,10,2,20,5,10,50,10,10,2,20,20,1,1,50,20,10,2,2,20,5,1,1,2,2,20,50,1,1,10,1,1,2,10,5,50,1,50,10,20,5,5,1,20,20,1,50,20,50,1,1,2,5,50,5,5,1,2,20,2,50,50,2,50,20,1,2,10,1,20,2,20,10,5,1,20,1,50,5,50,2,50,20,1,5,2,10,1,10,50,50,20,2,1,50,20,1,10,2,20,10,2,50,5,2,10,10,1,5,1,1,20,20,50,2,1,5,20,1,10,10,2,20,50,10,10,20,20,1,5,20,1,1,5,20,50,5,2,2,5,1,10,10,20,5,10,20,5,1,10,2,1,5,2,5,2,50,10,20,1,5,20,5,50,10,2,20,10,50,1,5,2,50,20,5,1,20,20,5,20,10,1,50,20,5,5,50,20,10,10,20,1,2,2,5,1,1,20,20,50,50,2,10,50,5,50,20,1,50,20,20,10,20,2,50,20,2,5,50,2,1,2,20,5,10,5,20,2,5,10,1,20,50,20,5,20,5,1,2,20,20,2,5,10,1,5,20,50,1,2,2,1,1,2,2,1,20,5,1,1,50,1,5,50,10,1,20,20,20,10,10,50,50,10,50,5,1,50,10,50,20,5,2,5,5,5,2,2,50,50,20,10,50,20,1,50,5,5,5,50,50,1,50,20,20,1,5,2,20,1,10,5,5,10,1,10,50,1,10,20,10,5,10,1,10,20,50,1,20,1,1,10,50,1,2,5,50,50,10,1,50,10,50,1,10,20,20,1,20,20,5,50,20,10,20,2,5,50,20,1,50,1,5,1,1,1,10,1,5,20,50,10,50,20,5,20,50,50,2,10,2,1,10,50,2,10,20,10,50,10,1,50,1,1,1,20,50,50,10,50,50,1,1,10,10,2,1,20,20,20,20,10,1,1,20,10,10,10,20,50,2,1,10,2,1,10,5,5,1,20,2,2,10,1,2,2,1,50,10,20,10,10,10,5,20,5,1,20,2,10,2,50,20,10,1,10,1,20,5,2,20,10,10,50,20,5,20,10,5,1,50,20,1,1,20,20,20,5,1,2,2,2,2,10,20,20,1,5,50,20,50,20,10,1,10,5,50,50,1,20,50,5,1,10,1,50,20,5,1,50,50,2,20,50,50,1,1,50,10,50,1,5,10,20,20,5,1,5,20,2,50,5,2,1,1,5,5,5,50,5,20,5,50,2,5,1,2,20,1,50,1,50,50,1,10,2,10,10,1,5,5,50,20,2,20,5,50,50,5,5,50,5,2,2,5,5,20,5,5,20,20,20,10,1,10,2,5,10,20,50,10,20,1,2,10,1,5,5,10,5,2,2,50,1,5,10,2,5,50,50,20,2,1,1,5,20,50,20,2,10,50,1,2,2,20,10,5,2,20,1,2,2,20,50,2,50,50,50,10,5,50,1,2,2,20,2,20,50,2,10,10,10,10,2,50,50,2,10,2,5,1,10,10,20,10,2,5,2,1,2,1,5,50,20,1,5,50,1,10,10,5,5,20,5,2,2,20,10,2,2,2,20,2,10,50,20,2,2,50,1,20,2,20,10,1,10,2,2,10,5,50,20,1,5,50,2,5,1,20,10,10,50,50,2,20,20,1,2,10,1,20,10,10,2,2,5,50,10,1,10,1,20,10,10,10,50,20,1,1,50,1,20,20,20,10,2,1,1,20,2,10,10,5,5,10,5,10,20,50,20,10,1,50,50,1,20,50,5,50,10,1,1,5,20,5,5,20,10,2,1,50,50,1,20,5,5,20,20,5,2,10,1,50,1,10,5,20,50,20,10,10,1,2,10,20,20,5,1,20,20,10,20,10,1,5,20,1,5,50,20,2,10,50,1,20,10,2,10,1,20,2,2,2,1,10,5,50,10,2,20,5,10,50,2,50,5,10,1,10,1,50,5,1,1,20,20,1,10,1,50,20,2,50,20,1,1,20,10,50,20,5,10,10,5,50,1,1,50,10,5,20,2,1,1,5,5,50,2,1,1,1,20,20,50,20,5,5,2,5,2,10,20,10,1,1,10,20,1,20,50,20,2,5,50,10,1,1,10,20,2,1,2,50,20,20,1,1,10,20,5,20,1,1,1,1,50,10,10,2,50,20,1,5,2,1,20,10,2,2,5,5,10,10,20,20,10,20,2,2,10,10,2,20,2,10,1,5,50,2,1,10,20,1,50,10,50,20,20,10,5,1,2,50,50,10,5,1,10,50,2,1,10,2,10,50,1,20,10,10,2,1,10,10,2,20,1,5,2,1,2,20,2,5,10,50,50,50,2,2,5,1,50,1,1,50,5,50,20,2,2,2,20,2,20,50,5,20,5,1,1,20,1,20,50,1,5,5,1,5,20,1,1,20,50,5,10,20,2,2,20,2,2,10,2,5,20,50,2,1,10,2,1,50,10,2,2,20,50,1,10,5,10,5,1,10,1,10,2,20,20,1,2,2,50,5,20,1,50,50,50,2,10,5,20,50,20,1,50,10,50,2,5,1,2,50,10,2,20,2,2,10,1,10,20,5,1,50,1,5,20,5,2,1,1,5,1,20,10,5,2,2,5,2,2,10,2,50,50,2,20,20,10,20,5,5,10,5,10,10,20,5,1,5,10,50,1,1,1,10,2,10,10,5,20,2,20,10,50,20,2,2,5,5,1,50,1,50,1,1,1,20,10,50,20,1,5,50,10,1,10,2,50,2,50,20,10,2,50,10,20,10,20,2,20,10,2,5,50,20,5,2,1,1,5,1,5,50,1,1,20,50,2,10,5,10,20,10,10,1,20,5,10,1,20,1,2,10,5,5,2,10,20,20,5,20,5,50,5,2,50,2,2,5,1,50,2,2,2,5,50,1,20,2,2,1,10,20,1,50,20,20,5,1,5,5,50,50,20,2,1,10,50,10,10,5,10,5,10,2,1,5,5,10,10,5,5,1,10,1,20,2,2,2,20,1,50,50,2,5,50,20,10,2,5,50,1,2,10,10,20,20,50,20,1,50,10,5,10,5,50,5,50,1,1,10,50,10,50,10,5,1,50,2,20,50,1,10,5,50,2,2,5,5,1,50,20,20,2,1,5,2,2,1,50,50,2,10,1,2,5,2,1,10,20,5,5,5,50,20,20,10,1,20,50,1,10,1,2,1,10,20,5,10,50,20,50,2,2,50,2,20,2,20,10,50,50,20,5,2,50,20,5,5,50,20,10,5,2,2,20,2,5,5,10,20,1,10,1,10,10,2,5,5,10,1,5,20,2,1,1,1,1,2,2,20,1,10,2,1,50,50,10,2,10,5,20,2,20,1,5,10,1,5,2,10,2,10,10,50,50,1,20,20,5,20,10,10,20,20,50,2,20,2,50,1,2,50,20,1,10,1,2,5,10,1,10,5,2,10,20,50,20,20,50,5,2,20,20,10,5,1,20,5,1,2,2,5,1,20,10,10,2,5,1,20,5,50,10,5,5,1,5,5,1,5,2,50,1,2,5,5,1,20,10,10,50,2,20,5,2,10,20,5,1,2,20,5,10,1,20,20,10,5,5,2,20,1,10,2,1,10,1,1,5,1,10,5,50,2,2,5,1,50,5,20,5,10,20,2,20,1,10,5,10,10,2,50,10,50,5,2,20,20,10,1,1,20,1,50,1,5,5,20,2,5,5,2,1,10,5,10,50,10,2,10,1,50,10,50,1,20,50,20,2,1,10,10,10,10,1,5,10,20,1,20,1,2,1,10,50,20,2,10,5,1,2,20,5,5,5,2,5,20,20,50,5,1,20,50,5,5,20,1,5,50,1,5,50,1,1,10,50,10,5,20,1,5,5,2,2,50,1,50,5,1,20,1,5,10,2,50,5,2,10,2,20,50,50,1,10,10,20,2,10,10,2,10,10,5,20,1,50,2,5,2,20,2,10,2,20,20,1,50,50,20,20,10,5,20,2,50,50,50,50,50,5,10,1,50,5,5,5,50,5,2,2,10,50,20,10,2,20,2,50,2,2,2,10,20,5,2,5,1,50,5,10,50,5,5,50,20,2,20,10,1,50,10,5,50,5,2,1,2,1,10,5,10,1,5,10,50,10,20,1,50,5,1,2,2,50,2,5,5,2,50,5,50,20,1,5,50,2,1,10,50,2,5,2,10,5,20,20,20,5,5,2,20,50,5,20,10,20,20,5,5,20,50,20,20,10,1,2,10,1,50,10,10,5,10,10,2,10,5,10,20,1,20,2,1,10,2,50,1,50,20,50,50,1,10,1,2,50,10,2,2,50,20,2,50,5,2,5,50,2,50,20,2,10,2,20,20,50,2,50,5,20,2,10,10,1,10,5,50,50,1,50,5,50,20,20,50,5,50,5,20,2,20,2,2,20,10,2,5,10,2,20,1,50,1,10,5,2,20,20,10,20,1,50,20,20,50,2,50,5,5,2,20,1,50,5,50,2,20,10,20,50,10,50,2,20,20,20,2,1,20,10,5,2,10,10,2,20,2,1,10,2,5,20,10,1,10,1,50,2,50,5,5,10,10,50,10,10,20,2,2,10,10,50,20,5,5,20,50,2,10,20,10,1,20,1,1,1,50,2,1,10,2,5,50,20,20,10,2,1,50,50,5,20,50,5,1,2,1,20,2,5,5,50,5,2,1,50,10,1,20,1,10,10,1,20,10,20,10,50,20,50,1,50,20,1,20,5,2,5,1,50,10,2,10,2,50,5,10,1,10,5,1,5,20,10,5,2,2,5,50,1,10,2,50,5,5,1,20,1,50,10,2,20,1,50,2,2,10,50,5,1,2,5,5,50,50,2,10,2,50,10,20,2,2,1,50,2,5,2,1,50,1,50,10,10,20,20,50,1,1,20,50,10,50,5,5,20,50,20,2,1,5,5,5,10,2,2,2,50,20,5,50,2,50,20,5,2,50,50,1,5,50,2,5,10,2,1,50,50,10,10,20,10,10,50,1,10,50,20,50,20,20,1,10,5,10,20,1,10,20,2,1,5,1,10,20,10,5,50,5,50,10,2,20,2,20,2,20,10,10,20,50,2,5,10,10,20,50,50,1,2,2,10,10,10,2,1,50,10,50,20,1,20,1,1,1,50,5,50,5,50,20,50,10,1,1,1,1,20,50,1,1,20,50,20,1,5,5,1,10,50,5,50,2,20,1,50,2,50,50,5,20,5,2,10,10,1,5,5,1,2,20,5,20,1,2,1,50,5,50,1,50,50,20,20,1,1,2,5,10,1,50,10,10,50,2,20,5,2,2,20,1,10,20,5,1,50,10,20,5,2,5,2,20,10,50,2,5,1,5,1,2,5,1,20,5,50,2,10,20,2,10,50,20,5,1,50,1,10,2,50,1,5,10,2,50,2,2,50,5,50,20,50,2,1,5,10,5,20,20,2,5,5,5,1,20,20,50,1,50,20,20,2,50,50,50,50,2,1,20,1,20,2,5,2,1,50,50,1,2,1,5,50,1,50,5,1,2,2,1,50,50,10,50,50,2,50,1,50,2,10,20,20,1,50,1,50,10,20,10,2,2,50,1,10,1,5,5,10,50,5,5,2,2,20,20,10,1,5,10,2,20,20,2,1,50,50,20,50,10,10,10,5,2,50,50,50,1,5,2,50,50,1,50,50,50,1,50,2,20,50,1,10,20,1,20,1,50,5,1,5,2,50,20,1,20,50,2,1,20,1,20,1,1,5,1,10,5,2,20,5,50,1,5,10,50,50,2,50,2,1,1,50,1,1,50,1,5,20,50,2,20,20,20,5,50,2,2,1,2,20,50,10,1,5,5,5,50,2,1,10,20,50,10,5,50,20,5,5,5,50,50,20,10,1,10,5,20,20,5,10,5,2,5,2,20,5,5,10,20,1,5,20,10,5,1,1,50,10,50,2,50,50,20,1,5,20,1,5,10,50,50,20,50,5,5,2,50,5,50,1,2,5,10,2,2,5,5,20,1,2,1,1,2,20,20,5,2,10,2,50,50,2,2,10,2,2,1,1,5,2,1,1,10,2,10,10,1,20,10,50,50,10,1,20,2,10,1,5,5,1,20,50,20,5,10,5,5,50,5,10,20,2,10,50,20,2,2,50,20,20,2,1,1,50,5,50,20,10,10,50,10,1,5,5,5,2,50,20,50,5,2,10,50,50,20,20,5,1,1,10,10,50,20,50,1,50,10,20,50,10,20,1,10,2,50,2,50,5,20,20,10,10,50,50,1,20,20,10,50,1,1,5,20,20,10,5,10,2,5,20,20,20,1,2,10,50,10,50,2,5,20,5,5,5,2,50,10,10,1,10,2,2,1,5,5,10,10,50,10,50,2,1,20,50,50,20,2,50,1,10,10,1,50,1,2,2,10,20,5,1,2,1,50,1,2,5,20,50,20,10,2,10,2,20,20,2,50,2,20,1,5,20,50,50,2,10,2,20,5,20,10,10,2,2,20,5,2,20,10,20,2,50,20,5,1,5,2,2,5,1,2,5,50,2,10,20,50,20,50,1,20,50,5,10,1,1,5,20,1,10,50,5,1,20,20,1,10,10,5,1,5,10,1,10,50,1,2,50,2,50,1,50,2,20,1,20,10,10,20,10,20,5,2,1,20,10,50,50,50,50,1,50,2,50,20,50,5,10,50,50,2,50,10,5,20,1,20,20,5,10,1,10,50,10,20,10,2,5,50,50,10,50,50,20,20,10,10,5,10,10,5,20,20,1,5,2,1,1,5,1,2,20,50,10,50,5,2,10,50,5,10,2,5,10,10,5,50,5,20,2,1,50,50,50,5,50,20,2,2,5,50,50,2,20,2,1,5,1,20,1,5,1,2,50,1,10,10,50,20,50,20,2,1,5,50,5,10,10,20,1,10,2,1,2,2,20,2,10,50,5,5,50,1,10,1,20,10,1,2,2,10,10,1,1,1,10,50,5,1,5,1,5,5,1,10,20,2,20,10,50,2,5,5,50,50,1,5,5,5,5,20,50,2,10,1,2,1,5,20,1,2,20,10,2,1,20,10,20,20,20,5,10,20,20,1,1,10,1,5,5,5,20,2,1,10,5,2,5,5,10,2,1,50,50,2,2,20,50,50,50,50,50,5,20,50,1,1,50,5,2,10,20,20,1,1,2,10,50,2,2,2,2,1,20,50,5,20,10,20,2,50,2,10,2,2,10,5,50,2,1,5,1,20,20,20,2,50,2,10,50,50,5,5,5,5,2,20,2,20,10,50,5,1,10,50,1,5,50,5,5,5,2,1,50,10,5,5,20,10,50,10,50,10,1,2,1,2,2,1,20,10,10,20,20,5,5,10,2,50,10,2,2,20,2,50,50,2,50,1,1,5,10,5,10,1,20,10,10,20,5,50,1,1,10,1,5,20,10,2,5,2,50,20,1,1,2,1,2,20,1,1,10,10,50,5,1,10,2,1,50,5,50,2,50,1,2,1,10,10,10,2,1,50,50,10,20,50,10,10,1,10,10,2,20,20,50,2,2,2,2,5,5,20,1,50,5,1,50,2,50,20,50,5,2,20,10,10,50,2,10,20,20,2,2,5,10,5,5,5,10,50,50,20,10,5,50,2,10,50,1,1,5,20,50,50,10,20,10,50,5,20,2,10,2,50,5,50,5,10,50,2,10,20,50,1,2,2,10,5,1,50,20,2,10,20,5,20,5,10,20,1,10,5,10,50,5,50,10,5,10,5,5,5,20,2,20,20,5,5,50,2,1,2,5,20,50,10,50,50,20,10,2,5,20,5,10,20,20,50,5,2,10,1,50,1,1,2,20,20,1,20,5,50,50,1,20,2,50,2,50,20,50,50,20,2,2,2,1,20,2,1,50,50,10,50,5,20,20,5,50,1,2,10,5,5,20,5,50,1,1,1,20,20,1,2,50,50,1,10,10,1,20,20,50,50,50,50,20,10,10,50,5,10,2,20,20,1,1,20,1,10,20,10,10,20,5,50,20,5,1,20,1,2,2,10,50,20,2,5,1,50,1,1,1,10,5,5,50,5,10,50,20,1,2,50,50,2,20,1,2,5,50,2,5,1,2,1,10,2,10,2,20,2,1,2,1,2,20,1,5,1,5,20,2,10,20,1,10,10,10,20,10,50,10,5,20,10,2,50,1,2,20,5,10,50,50,20,2,10,5,10,50,20,10,20,10,10,2,5,20,20,2,2,2,5,2,20,5,50,50,2,50,50,1,1,1,2,10,5,50,2,10,5,2,10,1,50,2,10,2,1,20,10,2,1,10,2,2,10,1,50,5,10,50,2,20,10,2,20,2,50,10,10,5,20,5,20,20,50,50,5,20,10,1,5,1,2,2,2,1,10,50,50,10,5,10,5,50,10,5,5,2,20,20,50,20,20,20,20,2,10,5,20,10,2,10,1,2,20,1,50,1,1,50,2,10,1,2,50,20,1,5,10,2,2,50,20,10,50,10,20,2,5,1,20,20,1,20,20,20,1,50,10,50,50,1,2,10,5,10,50,20,1,1,10,10,5,10,2,2,5,2,5,50,5,5,50,20,20,50,1,1,20,20,5,5,50,20,1,5,5,5,50,1,10,5,5,5,1,50,10,5,10,1,10,50,20,1,2,2,1,1,1,10,10,50,5,50,50,5,1,2,2,10,50,5,20,1,10,1,5,50,20,10,50,1,2,50,1,5,10,2,2,2,5,20,20,50,20,1,20,5,2,1,50,2,10,1,5,1,10,20,2,1,10,1,1,5,10,1,10,50,50,5,10,10,50,5,2,1,10,20,50,50,10,50,1,10,20,2,5,2,5,50,2,50,10,2,5,20,5,2,5,10,10,5,1,1,20,20,2,2,10,2,50,1,20,10,2,2,1,1,20,10,5,2,20,2,1,20,50,5,20,20,2,50,1,1,20,20,50,2,2,20,5,5,2,2,1,10,2,1,20,5,5,2,2,50,1,50,5,10,1,5,20,10,5,20,2,2,5,10,5,20,2,50,2,5,1,10,5,10,1,5,20,10,2,2,1,1,1,1,20,50,2,5,10,50,10,2,50,20,10,20,1,20,20,5,10,1,1,20,1,50,10,20,5,10,50,1,10,5,10,10,1,50,20,50,5,10,5,50,50,5,50,50,2,20,2,20,5,50,10,5,2,20,20,2,50,20,1,1,2,10,20,10,5,50,20,20,1,50,1,20,1,20,2,20,1,20,2,2,10,1,50,2,2,10,2,10,10,5,2,1,10,10,5,50,5,50,50,10,20,20,10,20,10,2,10,10,2,1,20,20,10,5,2,5,1,1,5,5,10,50,50,20,50,2,50,20,1,2,20,50,1,2,50,50,50,20,50,20,5,5,50,10,10,50,1,2,5,2,5,10,2,2,2,5,10,1,1,20,1,1,50,50,10,20,20,1,20,1,50,5,50,2,50,5,20,50,5,2,5,1,20,20,2,2,2,1,2,1,10,5,20,2,2,2,10,50,50,1,20,1,20,20,20,5,10,20,1,10,10,20,2,1,20,2,10,2,1,10,20,2,1,10,5,20,1,5,10,2,20,10,20,50,2,2,2,20,10,10,50,50,5,50,50,10,10,50,1,50,50,20,20,2,2,10,10,1,20,2,1,2,10,2,20,10,10,2,50,5,50,10,2,1,10,1,2,10,50,2,20,10,1,2,50,10,10,20,10,2,2,10,2,50,1,10,50,50,50,50,1,50,10,2,2,5,1,50,50,1,1,50,50,1,1,10,2,20,5,2,50,5,50,10,10,10,1,2,50,2,2,10,10,20,2,5,10,2,2,5,1,5,5,5,5,5,5,5,20,50,50,2,5,20,1,5,10,5,20,1,2,10,20,20,20,50,2,5,2,20,5,2,10,1,50,20,10,2,20,5,50,1,5,2,10,2,10,5,2,20,10,2,20,20,10,1,2,10,10,20,10,2,5,50,50,2,2,2,1,50,10,5,20,2,2,1,50,50,1,1,5,50,2,10,20,50,5,2,5,50,10,5,5,10,2,1,1,5,50,1,50,5,50,2,50,50,20,1,20,2,50,20,50,50,50,5,5,1,1,2,50,50,10,1,1,1,50,5,5,10,5,5,50,5,50,1,1,10,1,20,10,5,10,50,10,1,1,1,2,10,10,20,2,20,1,50,20,5,10,1,5,50,50,5,10,10,10,50,5,1,20,10,50,5,10,1,20,10,10,50,50,50,50,50,20,50,1,5,1,20,50,2,20,1,50,5,50,1,50,2,1,1,50,50,5,1,2,20,5,5,1,5,5,10,5,10,50,5,50,2,5,1,50,50,10,10,50,5,2,10,50,20,20,2,50,5,50,2,20,5,20,50,20,20,20,5,50,20,20,20,10,20,50,5,2,5,1,1,1,20,2,50,5,2,1,20,2,1,2,1,5,20,5,10,20,20,50,20,5,2,10,50,1,1,2,10,10,5,1,2,1,10,1,50,5,1,2,10,2,1,2,50,5,1,2,5,50,5,10,20,20,1,50,20,5,50,2,10,5,2,20,50,1,2,10,2,10,10,1,5,10,50,20,2,2,50,20,10,10,1,10,5,1,2,10,5,1,5,1,2,1,1,5,1,2,5,1,10,10,5,20,50,10,1,5,2,2,10,10,10,5,10,20,10,20,50,10,20,1,1,10,2,5,2,10,1,50,10,5,20,2,1,50,10,20,1,1,5,5,20,20,20,1,1,50,20,2,10,10,10,2,20,1,2,1,5,50,2,20,5,1,1,1,5,5,1,2,20,50,1,20,10,10,10,50,2,1,2,20,20,2,20,10,2,2,50,2,20,20,2,1,20,2,1,50,50,2,10,2,20,20,2,20,2,10,2,20,10,20,50,10,20,10,5,2,2,50,20,10,50,20,50,20,50,1,1,50,5,2,5,1,20,10,5,2,1,5,5,5,2,50,10,50,10,20,50,2,10,1,10,2,10,1,10,1,1,20,10,5,20,20,50,2,5,20,20,10,5,5,2,50,50,10,5,1,5,1,20,20,2,10,50,50,2,2,5,20,50,20,50,5,10,1,10,50,2,10,1,50,1,50,1,5,10,1,50,50,1,1,1,20,2,50,20,5,1,50,50,20,10,20,20,2,50,5,1,10,50,20,20,5,5,1,50,50,5,2,50,50,10,2,5,10,50,1,5,2,1,10,50,2,2,20,1,20,5,5,50,5,50,10,2,20,20,1,2,5,1,20,1,10,50,5,10,20,1,1,2,1,2,50,10,10,50,50,50,10,1,50,5,20,1,1,20,50,1,10,50,5,50,5,1,20,50,1,50,5,5,20,10,10,50,10,20,10,50,10,2,20,10,10,50,1,50,10,20,5,10,5,50,2,10,10,1,1,2,20,50,20,20,50,1,50,10,1,10,20,50,2,50,1,50,5,20,10,20,5,2,5,1,20,1,5,1,2,20,10,2,1,50,2,1,20,20,50,5,50,2,10,2,50,50,10,2,10,5,1,20,1,1,10,5,10,10,5,20,20,10,1,1,10,1,10,20,2,20,5,20,10,10,10,5,2,5,5,50,2,50,1,5,2,5,5,2,20,50,20,50,50,1,50,2,20,10,50,10,10,20,2,1,2,2,5,50,10,5,5,5,5,50,50,2,20,50,20,1,5,1,2,20,10,10,2,5,50,50,2,1,10,20,1,20,20,10,2,1,20,10,10,2,10,2,10,5,1,50,20,50,20,10,1,2,20,5,10,20,5,2,10,2,20,50,10,20,50,20,1,50,10,5,10,10,1,50,10,2,5,1,2,20,20,1,50,20,2,2,20,2,20,5,10,5,2,10,5,20,50,10,10,5,1,5,10,1,20,50,2,20,50,50,2,5,10,50,50,5,50,10,20,2,5,1,1,10,2,1,5,10,50,50,1,2,10,50,1,2,10,10,1,2,2,10,1,20,5,1,50,20,50,2,10,50,20,1,2,5,20,50,10,5,2,5,2,2,5,50,1,50,50,1,10,10,2,2,1,20,50,20,1,50,10,20,5,5,20,5,20,10,1,10,1,50,10,5,2,20,20,5,5,20,5,2,20,20,2,50,2,5,1,10,20,5,10,5,1,5,1,2,2,1,1,10,10,20,2,2,50,50,5,5,20,20,50,50,1,10,5,1,2,10,50,20,10,5,1,50,5,50,50,5,1,20,2,1,5,2,20,5,5,5,1,50,5,5,50,5,20,1,2,20,2,10,50,20,10,5,1,5,5,5,5,1,1,10,20,50,10,5,10,5,5,20,5,20,20,5,2,20,5,50,20,5,1,5,10,50,1,2,2,2,20,50,2,50,20,1,1,1,2,5,50,2,5,20,10,20,50,10,5,20,20,20,1,5,2,2,50,50,20,10,50,50,1,2,1,5,20,10,5,10,50,1,20,5,1,20,5,5,2,2,50,10,1,10,1,1,20,50,20,2,50,5,5,1,50,10,20,20,1,1,50,20,10,2,1,50,20,2,50,10,20,1,10,2,1,10,2,20,20,5,5,50,5,50,5,2,50,1,10,20,10,20,10,20,2,50,5,50,50,5,20,50,10,20,5,1,1,1,10,1,10,1,1,1,5,1,20,5,5,5,5,5,20,50,5,1,2,1,5,5,5,5,5,1,5,1,20,2,2,1,5,50,10,5,5,1,10,10,10,2,1,20,20,50,5,10,10,50,20,50,1,20,20,1,10,50,5,5,5,10,50,50,1,5,10,10,10,5,10,20,20,1,2,1,1,2,2,2,1,5,50,2,1,5,5,1,2,10,1,50,1,20,2,50,5,50,10,2,50,1,2,2,5,20,1,5,2,1,5,2,50,1,1,10,50,5,50,20,5,10,1,10,10,10,2,50,1,5,2,50,5,1,5,5,10,10,20,2,10,5,50,50,1,2,10,10,20,20,20,2,2,1,5,1,1,10,1,2,20,2,50,10,50,5,1,1,50,10,50,2,1,2,2,5,50,20,20,20,20,50,20,10,1,2,50,10,1,20,2,10,1,2,20,50,10,20,20,2,20,2,20,1,5,10,20,1,2,10,10,50,20,10,20,5,20,20,20,1,2,2,1,1,50,50,5,10,5,5,20,10,50,50,5,1,20,20,20,50,20,20,2,2,20,10,50,2,20,20,10,2,50,1,20,20,20,5,5,5,1,50,20,2,20,2,20,50,50,50,20,5,50,5,50,2,20,50,10,1,5,10,1,1,20,1,50,10,5,50,2,10,1,2,10,50,1,10,10,2,5,10,5,1,20,1,20,20,20,2,1,10,5,10,50,20,5,20,2,20,50,50,10,2,2,10,10,1,2,2,50,10,5,20,20,2,5,50,2,5,2,20,2,1,2,20,10,10,1,50,50,50,20,10,2,2,50,10,1,5,2,5,5,20,2,10,2,2,5,10,2,1,50,2,20,1,10,1,50,10,10,2,5,50,10,2,10,20,2,1,50,20,50,1,5,50,50,20,2,20,2,50,50,1,50,5,2,2,2,50,2,20,20,5,20,2,20,1,2,50,1,5,5,10,2,10,1,20,2,50,5,10,5,5,5,50,50,20,5,2,20,10,10,50,10,5,2,50,1,10,50,20,50,20,5,1,2,20,5,20,20,10,20,2,5,50,10,10,1,10,20,20,20,2,10,20,20,10,20,1,50,50,5,10,50,10,5,2,50,20,1,5,50,20,20,10,50,1,5,10,2,5,2,20,20,20,10,5,1,10,1,10,50,5,1,2,2,10,5,10,50,10,2,20,10,1,1,10,20,2,10,5,2,1,5,10,1,10,1,5,50,50,5,10,2,20,1,1,2,20,1,5,1,2,50,50,10,10,2,50,10,50,10,5,5,10,1,10,10,50,2,50,50,1,20,2,1,2,2,5,50,10,2,20,20,20,1,10,10,5,1,20,2,5,2,10,5,20,1,20,2,10,5,50,2,50,1,2,5,50,1,5,2,50,20,5,50,1,50,1,1,1,5,5,2,1,10,50,50,5,20,5,5,5,10,10,50,20,10,50,10,10,2,20,10,10,5,20,50,10,20,5,5,5,10,50,1,50,10,2,50,50,2,10,10,10,1,2,10,1,50,2,5,2,1,5,2,2,2,1,2,50,50,1,1,2,1,2,50,10,1,5,20,10,2,2,10,20,20,20,5,50,20,2,20,2,1,10,1,50,1,5,1,10,1,20,50,10,1,5,50,20,10,20,50,2,10,20,1,5,5,5,1,10,5,1,2,20,20,5,2,50,5,5,1,1,50,5,10,2,1,20,5,1,5,50,10,50,5,20,5,10,50,1,2,10,50,5,10,5,2,50,2,2,50,2,20,5,1,2,50,2,50,5,20,5,10,1,50,1,5,2,50,50,5,50,5,5,1,50,1,5,2,1,5,50,1,20,10,20,20,5,2,20,10,50,2,10,10,50,20,20,5,5,50,10,50,10,1,5,1,50,50,1,10,20,20,20,50,1,2,20,2,50,50,2,5,5,1,10,1,50,2,1,5,2,2,2,2,50,50,2,5,2,50,20,50,20,50,20,10,1,1,50,2,1,5,2,10,1,5,50,5,5,50,1,10,1,1,20,1,20,20,10,50,2,10,10,50,5,5,5,20,50,10,2,5,50,20,5,5,1,1,2,1,5,1,5,2,50,5,1,2,5,1,1,10,1,5,1,5,2,50,20,5,2,1,20,20,50,1,2,5,5,5,5,50,2,10,5,2,2,2,2,1,1,20,50,20,1,2,10,5,2,10,10,2,10,1,10,20,5,2,5,50,5,5,5,2,20,20,2,2,20,20,2,10,1,1,2,10,1,5,50,1,50,1,5,5,1,50,2,2,50,50,1,5,50,1,20,5,5,2,10,20,5,20,50,2,5,5,5,1,50,1,2,50,20,1,10,2,5,2,10,1,20,2,2,2,20,5,2,10,20,10,2,5,20,20,1,5,5,2,20,5,1,1,20,50,50,2,1,5,5,1,50,1,1,50,50,10,10,1,20,10,20,2,10,10,20,1,50,1,50,10,1,50,1,10,10,50,50,2,1,20,1,5,1,10,50,20,20,50,50,5,50,50,5,50,20,1,1,5,20,20,50,50,5,5,20,20,50,50,5,1,1,20,5,1,2,20,2,20,2,20,50,1,50,50,1,2,50,2,10,10,5,20,50,20,20,2,5,1,10,5,50];

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
marcin
const sortCoins = (data) => {
    const coinList = {};
    const coinWorth = {};
    const coinRollMap = { 1: 40, 2: 40, 5: 30, 10: 50, 20: 20, 50: 40 };
    data.forEach(coin => {
        if (coinList[coin]) {
            coinList[coin] = coinList[coin] + 1;
            coinWorth[coin] = coinWorth[coin] + coin;
        } else  {
            coinList[coin] = 1;
            coinWorth[coin] = coin;
        }
    });
    return Object.keys(coinList).map(coin => {
        const coinRolls = Math.floor(coinWorth[coin] / (coin * coinRollMap[coin]));
        const coinsLeft = Math.abs((coinRolls * coinRollMap[coin]) - coinList[coin]);
        return { coin, coinRolls, coinsLeft }
    });
}
 
sortCoins(coinList);
pending…
karol
const ROLLS = [
    { coinValue: 1, coinCount: 40, label: 'Groszówka' },
    { coinValue: 2, coinCount: 40, label: 'Dwugroszówka' },
    { coinValue: 5, coinCount: 30, label: 'Pięciogroszówka' },
    { coinValue: 10, coinCount: 50, label: 'Dziesięciogroszówka' },
    { coinValue: 20, coinCount: 20, label: 'Dwudziestogroszówka' },
    { coinValue: 50, coinCount: 40, label: 'Pięćdziesięciogroszówka' },
]; //rulony
 
 
function printCoins( coinList = [] ) {
    ROLLS.forEach( (roll, rollIndex) => {
        const coinCount = coinList.filter(v => v === roll.coinValue).length;
        const rollCount = Math.floor( coinCount / roll.coinCount );
        const restCount = coinCount % roll.coinCount;
 
        console.log(`  ${rollIndex + 1}. ${roll.label}: - rulony: ${rollCount} - pozostałe: ${restCount}`);
    });
};
printCoins(coinList);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments