solve "Edit Distance"