Wrong answer by judge ???


  • 0
    J

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

    Input:
    "hot"
    "dog"
    ["hot","dog","dot"]
    Output:
    2
    Expected:
    3

    If you believe the judge is correct, Please tell me why.
    I'm so confused.


  • 0
    T

    Given:
    beginWord = "hit"
    endWord = "cog"
    wordList = ["hot","dot","dog","lot","log","cog"]
    As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog",
    return its length 5.


  • 0

    @tfarcenim I came across to this testcase too and the online judge says the expected steps should be zero. I am confused.


  • 0
    T

    @shurui there's another test case which is similar but returns 0
    "hit"
    "cog"
    ["hot","dot","dog","lot","log"]


Log in to reply
 

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