Weighted edit distance
Your task
Compute a weighted edit distance between strings a and b where insert costs ci, delete costs cd, and substitute costs cs per single character (a matching character costs 0). Return the minimum total cost to transform a into b. Costs are positive integers; lengths up to ~1000.
Examples
weighted_edit_distance(a: str, b: str, ci: int, cd: int, cs: int) -> intExample 1
Input
weighted_edit_distance("abc", "abd", 1, 1, 1)Output
1