Two arrays similar to 0 1 knapsack problem
let val = Array . from ( { length : N } , ( _ , i ) => 0 ) ; let wt = Array . from ( { length : N } , ( _ , i ) => 0 ) ; let c = 0 ; for ( let i = 0 ; i < N ; i ++ ) { str = v [ i ] ;