## Thought process for solving the problem
npm install @amitbd1508/max-packageI identify this problem as a 0-1 Knapsack Problem. So simply I can use dynamic programing(DP) solution of 0-1 Knapsack to solve this problem, but the DP solution doesn’t work if item weights are not integers.
So we can't use the DP approach.
In this case we can use a brute force solution, but in this case 2^n number of solution is generated. Which is not a good solution.
Backtracking based solution is better than brute force in this case, but we can use a better solution if we know a bound on best possible solution subtree rooted with every node.
Every time we can update the current best with the best subtree. In the end we can have a solution which is best among all.
This technique is called as branch and bound, and I use it for solving this maximization problem
git clone https://github.com/amitbd1508/max-package.gitcd max-packagenpm install for installing all dependenciesnpm run buildnpm run buildcd examplenpm installexample/src/index.ts file please provide a input file location npm start npm run test