public int findMaxValue(int sackSize, int N, int val[], int wts[]) {
		int maxVals[][] = new int[N+1][sackSize+1];
		
		for(int i=0; i<=N; i++) {
			for(int w=0; w<=sackSize; w++) {
				
				if(i==0 || w==0)
					maxVals[i][w] = 0;
				else if(wts[i-1]>w)
					maxVals[i][w] = maxVals[i-1][w];
				else {
					maxVals[i][w] = Math.max(val[i-1]+maxVals[i-1][w-wts[i-1]], maxVals[i-1][w]);
				}
			}
		}
		return maxVals[N][sackSize];
	}