A wrapper over countStrUtil ( )
function countStr ( n , bCount , cCount ) { dp = Array ( n + 1 ) . fill ( 0 ) . map ( x => Array ( 2 ) . fill ( 0 ) . map ( x => Array ( 3 ) . fill ( 0 ) ) ) ; for ( i = 0 ; i < n + 1 ; i ++ ) { for ( j = 0 ; j < 2 ; j ++ ) { for ( k = 0 ; k < 3 ; k ++ ) { dp [ i ] [ j ] [ k ] = - 1 ; } } } return countStrUtil ( dp , n , bCount , cCount ) ; }