Boolean DP table to store result of states . dp [ i , j ] = true if there is a subset of elements in first i elements of array that has sum equal to j .
boolean [ ] [ ] dp = new boolean [ n + 1 ] [ k + 1 ] ;