Help me in solving DAA166 problem

My issue

give me full code

My code

#include <stdio.h>
#include <stdbool.h>

#define MAXN 20 // Maximum value of N as per the problem constraints

int N, X;
int A[MAXN];
bool currentSubset[MAXN];

void findSubsets(int index, int sum) {
    if (index == N) {
        if (sum == X) {
            // Print the subset that sums up to X
            printf("%d", A[0]);
            for (int i = 1; i < N; ++i) {
                if (currentSubset[i]) {
                    printf(" %d", A[i]);
                }
            }
            printf("\n");
        }
        return;
    }

    // Include A[index] in the current subset
    currentSubset[index] = true;
    findSubsets(index + 1, sum + A[index]);

    // Exclude A[index] from the current subset
    currentSubset[index] = false;
    findSubsets(index + 1, sum);
}

int main() {
    scanf("%d %d", &N, &X);
    
    for (int i = 0; i < N; ++i) {
        scanf("%d", &A[i]);
    }

    findSubsets(0, 0); // Start finding subsets from index 0 with sum 0

    return 0;
}

Learning course: Analysis and Design of Algorithms
Problem Link: Subset sum problem in Analysis and Design of Algorithms

Subset sum problem

You have NN positive integers ithith integer begin AiAi​, and a number XX.

Return all the subsets of these NN integers such that the sum of the integers (in the subset) is equal to XX.

Input Format

  • The first contains a two integers NN and XX, denoting the length of array AA and the target sum value.
  • The second line of each test case contains NN space-separated integers A1,A2,…,ANA1​,A2​,…,AN​ — denoting the array AA.

Output Format

Return the list of all the subset of integers which fulfil the target sum value.

Sample 1:

Input

Output

5 4 1 1 2 3 4

1 1 2 1 3 1 3 4