mat [ i ] [ j ] stores the count of occurrences of T ( 1. . i ) in S ( 1. . j ) .
let mat = new Array ( m + 1 ) ; for ( let i = 0 ; i <= m ; i ++ ) { mat [ i ] = new Array ( n + 1 ) ; for ( let j = 0 ; j <= n ; j ++ ) { mat [ i ] [ j ] = 0 ; } }