Why its show wrong answer?
hello @Nikhil-Jettley-2567269533523013
a) use long long in place of int .
b)
this is not correct way of intitialisation , it will initalise on index n with 0.
rest will contain garbage value.
follow this->
long long n;
cin>>n;
long long dp[n+1];
memset(dp,0,sizeof(dp));
srry , i didnt get ur doubt
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.