Optimal Binary Strings Recursion

is this the correct code for this problem?

hello @anshgoel_02

yeah its correct

I think your base case should be modified a bit.
it prints 1 when n=0 which is wrong and should print 0.
Modify ur base case to
if(n<=0)
return 0;
if(n<=2)
return n+1;