Here is my code’s link for problem count number of binary string. I can’t figure out what is wrong here.
Wrong answer for count numbre of binary strings
its not getting accepted even after using long long
@Jatin-Arora-2232866133621749
Just one mistake
While giving output you didnt take mod
Do cout << (dp[n][0]+dp[n][1])%mod << endl;
Thank you!!!
1 Like
@Jatin-Arora-2232866133621749 it is not mentioned in the problem statement to take mod of the answer, so no need to take mod here.
in your earlier version version of your code just use long long int to store your dp array.
look at this i have updated it in yours https://ide.codingblocks.com/s/243869
Thanks!!!