To fill dp [ ] [ ] for finding largest sub matrix with all elements 0
for ( let i = 0 ; i < col ; i ++ ) { let cnt = 0 ; for ( let j = row - 1 ; j >= 0 ; j -- ) { dp [ j ] [ i ] = 0 ; if ( a [ j ] [ i ] == 0 ) { cnt ++ ; dp [ j ] [ i ] = cnt ; } else { cnt = 0 ; } } } for ( let i = 0 ; i < row ; i ++ ) {