further optimise space

use 1D array to represent the knapsack