calculates length
int n = s1 . Length ; int m = s2 . Length ; bool [ , ] dp = new bool [ n + 1 , m + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= m ; j ++ ) { dp [ i , j ] = false ; } }