Is it true that both start and end words have been implicitly included in the dictionary?


  • 2
    Y

    The problem statement is below.
    "Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:
    1.Only one letter can be changed at a time
    2.Each intermediate word must exist in the dictionary
    ..."

    Conditions 1 and 2 above do not require that the start and end words must be in the dictionary as confirmed by the given example, i.e., the words "hit" and "cog" are not in the given dict ["hot","dot","dog","lot","log"].

    However, when testing my own solutions, I found that one of the solutions that is based on an assumption that both the start and end words MUST BE in the dictionary gets accepted, which means that this assumption holds in all the existing test cases for this problem.

    Could the admin check if this is true? If yes, could we get it fixed? It is easy to fix it by removing the start and end words from the dictionary before executing the submitted code.


  • 0
    X

    Yes, I also found this error: the problem statement is controdicted with the test case .
    eg, it uses "a","c",["a","b","c"] for test case but "a","c",["b"].


Log in to reply
 

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