dp [ i ] [ j ] indicates the length of LCS of A of length i & B of length j
var dp = Array . from ( Array ( n + 1 ) , ( ) => Array ( m + 1 ) . fill ( 0 ) ) ; for ( var i = 0 ; i < n + 1 ; i ++ ) { for ( var j = 0 ; j < m + 1 ; j ++ ) {