can goodwill sale or purchase. State reason in support of your answer
Answers
Answered by
6
Answer:
Have a bangtasitic day dear
Answered by
0
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