Answer of testcase: "a", "c", ["a","b","c"]


  • 0
    X

    Input: "a", "c", ["a","b","c"]
    Output: 1
    Expected: 2

    According to the problem description, I could change "a" -> "c" and the length turns out to be 1.
    I am confused by the expected answer... Did I miss something out?


  • 4
    M

    As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog",
    return its length 5.

    The length of the list is the number of elements, not the number of changes. Since there is "a" and "c", the answer is 2.


Log in to reply
 

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