Algorithms.
satisfies constraint. This solution can be expressed as tree. There are two options take(in) or do not take(out).So for each item there will be two possibilities. And at last take the most optimal solution from the lowest level. 4. Backtracking: Use Backtracking to optimize the Brute Force