dp [ i ] [ j ] contains length of shortest supersequence for X [ 0. . i - 1 ] and Y [ 0. . j - 1 ]
let dp = new Array ( m + 1 ) ; for ( let i = 0 ; i < ( m + 1 ) ; i ++ ) { dp [ i ] = new Array ( n + 1 ) ; for ( let j = 0 ; j < ( n + 1 ) ; j ++ ) dp [ i ] [ j ] = 0 ; }