declare dp [ ] [ ] and sum [ ]
let dp = new Array ( m ) ; let sum = new Array ( n ) ; for ( let i = 0 ; i < dp . length ; i ++ ) { dp [ i ] = new Array ( n ) ; for ( let j = 0 ; j < n ; j ++ ) { dp [ i ] [ j ] = 0 ; } } for ( let i = 0 ; i < n ; i ++ ) { sum [ i ] = 0 ; }