boolean subsetSum(int[] a, int n, int k) {
        if (k == 0) return true;
        if (n == 0) return false;
        if (a[n - 1] > k) return subsetSum(a, n - 1, k);
        return subsetSum(a, n - 1, k) || subsetSum(a, n - 1, k - a[n - 1]);
    }
This is brute force solution to find subset Sum.
Time Complexity is O(n^2) and Space Complexity is O(1);
src/algo/dp/SubsetSum.java