Compute distance between two strings.