Can you tell the place where my code is getting wrong
Calculate the of Sum
Hi @samyakjain1050_65748654e19948da,
if(x>i){
a[i]+=a[n-x+i];
}
if(x<=i || x==0){
a[i]+=a[i-x];
}
In the above conditions, you need to update the array simultaneously. So, create a new array and update like this
b[i] = a[i] + a[i-x]; and,
b[i] = a[i] + a[n-x+i];
Still the code is not working after adding new array
@samyakjain1050_65748654e19948da,
You also need to equate array a equal to b, and also 10^9+7 is wrong it should be 1000000007.
10^9 means 10 xor 9
I have made the corrections,
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.