It seems the board for Python language is not correct?


  • 8
    C

    I think the board for Python language should not be [ ["ABCE"], ["SFCS"], ["ADEE"] ], since for Python language string is immutable, we can not assign value like board[i][j] = "#". The board should be initialied as [ ["A", "B", "C", "E"], ["S", "F", "C", "S"], ["A", "D", "E", "E"] ] . The function input is type board: List[List[str]], which implies the inner parameter should be a list of strings . Word Search II gives the right figure.


  • 2
    Y

    Yes, the problem description is misleading. What the input really is List of Strings rather than List of List of Strings.


  • 0

    I have just updated Word Search's problem description so it is consistent with Word Search II.


  • 0

    This is not actually true. The inner representation is a List of List of Strings of size 1, although in custom input is different and looks like List of Strings.


Log in to reply
 

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