"rick", "irkc": remove the final character of "irkc" (insertion)
"rick", "irk": remove the final character of both strings at no cost
"ric", "ir": remove the final character of both strings at a cost of 1 (substitution)
"ri", "i": remove the final character of both strings at no cost
"r", "": base case, cost of 1.
In summary, "rick" -> "rickc" -> "ickc" -> "irkc".
"rick", "irkc": remove the final character of "irkc" (insertion)
"rick", "irk": remove the final character of both strings at no cost
"ric", "ir": remove the final character of both strings at a cost of 1 (substitution)
"ri", "i": remove the final character of both strings at no cost
"r", "": base case, cost of 1.
In summary, "rick" -> "rickc" -> "ickc" -> "irkc".