Question description misleading


  • 1
    R

    I think the question description is misleading. For example, according to my understanding of question, if board is ['abc', 'def'] and word is 'abce', the result should be True.

    The description says "The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once."

    Nowhere in my example are any of the constraints mentioned in the description violated.

    This becomes a much harder question if someone misunderstands it as I did.


  • 1
    S

    If board is ['abc', 'def'], it looks like below:

    abc
    def
    

    For word abce, how could it be possible matched? d cannot be reached, while we are in the c. Since, d is not c's adjacent cell.


  • 0
    R

    Yes, but the question does not say that you have to go through each letter in the word in order from left to right.


  • 0
    M

    In fact, it says exactly that.

    The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring.
    

    The words "sequentially adjacent" mean the letters must be able to be reached from the letter immediately previous to them. If it were as you are interpreting it, it would only be adjacent cells, not sequentially adjacent.


Log in to reply
 

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