Driver Code
let coin = [ 8 , 5 , 3 , 10 , 2 , 1 , 15 , 25 ] ; let n = coin . length ; preprocess ( coin , n ) ; let k = 3 ; document . write ( minCost ( coin , n , k ) + " " ) ; k = 7 ; document . write ( minCost ( coin , n , k ) ) ;