Example 1minDistance()InputCopyword1 = "horse", word2 = "ros"OutputCopy3Whyhorse → rorse → rose → ros