Is the test case correct ? Please comment?


  • 0
    A

    Input: ["ab","cd"], "abcd"
    Output: true
    Expected: false


  • 1
    Y

    yes the test case is correct.

    you may think of the grid like a chess board, like this

    | a | b |

    | c | d |

    Now the question is asking could you draw a line to with one stroke to connect abcd under the condition that the stroke can only be horizontal or vertical( i.e. no Z shape component in the stroke ). this is not possible.


Log in to reply
 

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