class Solution { // Function to calculate the number of subsets with a given sum public int perfectSum(int[] nums, int target) { int n = nums.length; // step-1 create a matrix int[][] t = new int[n+1][target+1]; // step-2 intialise the matrix with base condition for(int i=0; i