Given two strings word1 and word2 , return the minimum number of single-character edits needed to turn word1 into word2 . The allowed edits are inserting a character, deleting a character, or replacing a character. Input format Input is [word1, word2] , e.g. [ horse , ros ] .