Driver code
var arr1 = [ 8 , 15 , 3 , 7 ] var n = arr1 . length ; printCoins ( arr1 , n ) ; document . write ( " " ) ; var arr2 = [ 2 , 2 , 2 , 2 ] var n = arr2 . length ; printCoins ( arr2 , n ) ; document . write ( " " ) ; var arr3 = [ 20 , 30 , 2 , 2 , 2 , 10 ] n = arr3 . length ; printCoins ( arr3 , n ) ;