Why would the expected result be false for this test case?


  • 0
    S

    Hi:

    Why would the expected result be false?

    Input: ["aaa","abb","abb","bbb","bbb","aaa","bbb","abb","aab","aba"], "aabaaaabbb"
    Output: true
    Expected: false

    My program can find path as the following (number means the index within word)

                board		{'a','a','a'},
    					{'a','b','b'},
    					{'a','b','b'},
    					{'b','b','b'},
    					{'b','b','b'},
    					{'a','a','a'},							
    					{'b','b','b'},
    					{'a','b','b'},
    					{'a','a','b'},
    					{'a','b','a'}
    
    
    
    
    solution
    {   1	F	4
    	2	F	3
    	F	F	F
    	F	F	F
    	F	F	F
    	F	F	F
    	F	F	10
    	F	F	9
    	7	F	8
    	6	F	5       }
    

    Thanks in advance.


  • 0
    V

    Problem says "letters of sequentially adjacent cell" 4 and 5 may not be adjacent


  • 0
    S

    Why are 4 and 5 not considered as adjacent ?
    The example word = "SEE", -> returns true shows the adjacent one can be the one wrapped around the matrix.


Log in to reply
 

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