The examples in the question seem wrong?


  • 0
    F

    The following examples are given:

    For example,
    Assume that words = ["practice", "makes", "perfect", "coding", "makes"].

    Given word1 = “coding”, word2 = “practice”, return 3.
    Given word1 = "makes", word2 = "coding", return 1.

    I don't understand why if "coding" and "practice" are 3 away, "makes" and "coding" would be 1 away? Shouldn't "makes" and "coding" return 2?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.