Here is the link to my code,… Please help me solve the error
Segmentation fault in count binary code
hello @prerna_gupta31
cb ide has some server issue.
for now pls save ur code to some other ide and share the link with me
a)use long long for ut function return type.
b) also add return k ; in last of ur count function
It is still giving incorrect output, for input 12 output should be 8. https://www.geeksforgeeks.org/count-number-of-binary-strings-without-consecutive-1s-set-2/
for 12 answer should be 377 only .
the link that u have shared is diffrent problem than optimal binary string .
in optimal binary string u need to generate string of lenght n .
but here they are genrating string whose value <=n.