where cost = dist(s[i], t[j]), D is a matrix of size [0..n, 0..m], D[0, 0] = 0. Initially each entry of D[i, 0], for 0