Wrong answer for count numbre of binary strings

Here is my code’s link for problem count number of binary string. I can’t figure out what is wrong here.

hello @Jatin-Arora-2232866133621749
use long long

Hey @Jatin-Arora-2232866133621749
You’ve reopened this doubt
how can I help you ?

its not getting accepted even after using long long

@Jatin-Arora-2232866133621749
Please share your updated code here

@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

https://ide.codingblocks.com/s/243728 Its still not getting accepted

@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!!!