xxxxxxxxxx
class Solution
{
// function to count ways in which n can be
// expressed as the sum of two or more integers
int countWays(int n)
{
// your code here
int arr[]=new int[n-1];
int dp[] = new int[n+1];
dp[0]=1;
for(int i=0;i<n-1;i++){
arr[i]=i+1;
}
for(int x:arr){
for(int i=1;i<=n;i++){
if(i>=x){
dp[i]=dp[i]+dp[i-x];
}
}
}
return dp[n];
}
}