Given two strings word1 and word2, return the minimum number of operations required to convert word1 into word2.
You have three operations available, each counting as one step:
Input: word1 = "horse", word2 = "ros" Output: 3 Explanation: horse -> rorse (replace h with r) -> rose (delete r) -> ros (delete e), 3 operations.
Input: word1 = "intention", word2 = "execution" Output: 5 Explanation: intention -> inention -> enention -> exention -> exection -> execution, 5 operations.
0 <= word1.length, word2.length <= 500word1 and word2 consist of lowercase English lettersword1 = "horse", word2 = "ros"