Initialize dp
for ( var i = 0 ; i < M ; i ++ ) for ( var j = 0 ; j < 165 ; j ++ ) dp [ i ] [ j ] = Array . from ( Array ( M ) , ( ) => Array ( 2 ) . fill ( - 1 ) ) ; return count ( 0 , 0 , 0 , 0 , 0 , num ) ; }