Question d’entretien chez Amazon

write an algorithm to calculate the edit distance between two strings