Function to return the count of required strings
int countStr ( int i , string & s ) { if ( i < 0 ) { if ( check ( s ) ) return 1 ; return 0 ; } s [ i ] = '0' ; int ans = countStr ( i - 1 , s ) ; s [ i ] = '1' ; ans += countStr ( i - 1 , s ) ; s [ i ] = '0' ; return ans ; }