Dynamic Programming, Facebook Coding Interview, Google Coding Interview, Coding Interviews, Java.
without using any element dp[i][0] = true empty subset has zero sum so we can create subset of zero sum by using any number of elements i = 1 to nums.length j = 1 to totalSum dp[i][j] = dp[i-1][j] || dp[i-1][j-nums[i-1]] if j >= nums[i-1] dp[i-1][j] otherwise LIS Longest increasing subsequence