Initialize DP [ ] [ ] entries as - 1
for ( let i = 0 ; i <= count [ 0 ] ; ++ i ) for ( let j = 0 ; j < count [ 1 ] ; ++ j ) for ( let k = 0 ; k < count [ 2 ] ; ++ k ) DP [ i ] [ j ] [ k ] = - 1 ; return length ( count [ 0 ] , count [ 1 ] , count [ 2 ] ) ; }