Psychology, asked by sanjuktakusulia, 5 hours ago

how to change your life 7 facts or 5​

Answers

Answered by anushreeverma123
3

Answer:

Hello thanks for following me hope I can help u in questions

Answered by Anonymous
1

Explanation:

int checkpar(int n ,int arr[], int sum , int csum,vector<vector>int dp){

if(dp[n][csum] ==-1){

if(n==0){

if(sum-csum==csum) return 1; else return 0; }

dp[n][csum]= checkpar(n-1,arr,sum ,csum,dp)+ checkpar(n-1,arr,sum,csum+arr[n-1],dp);

return dp[n][csum];

} else return dp[n][csum];

}

int equalPartition(int N, int arr[]) {

int sum=0;

for( int i=0;i<N;i++){ sum+=arr[i];

vector<vector<int>>dp(N+1,vector(sum+1,-1));

return checkpar(N,arr,sum,0,dp); }

Similar questions