Dynamic Programming: 0/1 Knapsack Problem (1D & 2D DP)

Problem Given a list of weights and values and a total capacity, determine the maximum value that can be placed in the knapsack. 2D DP 1D DP (space optimized)