Segmentation fault in count binary code

Here is the link to my code,… Please help me solve the error

https://ide.codingblocks.com/s/336442

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

Sure! here is the link : https://onlinegdb.com/Bk28sVCEP

a)use long long for ut function return type.
b) also add return k ; in last of ur count function

It gives incorrect output -> https://onlinegdb.com/HyeyzCN0VD

check now->https://ide.codingblocks.com/s/336567

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.