Amazon Interview Question

write an algorithm to calculate the edit distance between two strings