Returns length of length common subsequence for str1 [ 0. . m - 1 ] , str2 [ 0. . n - 1 ]
function lcs ( str1 , str2 , m , n ) { let L = new Array ( m + 1 ) ; let i , j ; for ( i = 0 ; i <= m ; i ++ ) { L [ i ] = new Array ( n + 1 ) ; for ( j = 0 ; j <= n ; j ++ ) { L [ i ] [ j ] = 0 ; } }