Initialising the table with - 1
for ( int i = 0 ; i < 100001 ; i ++ ) { for ( int j = 0 ; j < 20 ; j ++ ) { for ( int l = 0 ; l < 2 ; l ++ ) dp [ i , j , l ] = - 1 ; } } Console . Write ( possibleBinaries ( N , 0 , 0 , K ) ) ; } }