Solve Edit Distance