parameters: (self, board, word)
return_statement: return False
docstring: :type board: List[List[str]]
          :type word: str
          :rtype: bool
docstring_summary: :type board: List[List[str]]
          :type word: str
          :rtype: bool
docstring_tokens: : type board : List [ List [ str ]] : type word : str : rtype : bool
function: def exist(self, board, word):
          """
          :type board: List[List[str]]
          :type word: str
          :rtype: bool
          """
          if not board:
              return False
          
          board_c = collections.Counter([c for row in board for c in row])
          word_c = collections.Counter(word)
          for c in word_c:
              if not c in word_c or word_c[c] > board_c[c]:
                  return False
              
          r, c = len(board), len(board[0])
          self.direct = [(-1, 0), (0, 1), (1, 0), (0, -1)]
          
          for i in range(r):
              for j in range(c):  
                  if board[i][j] == word[0] and self._exist(board, i, j, word, 0):
                      return True
          
          return False
function_tokens: def exist ( self , board , word ) : if not board : return False board_c = collections . Counter ( [ c for row in board for c in row ] ) word_c = collections . Counter ( word ) for c in word_c : if not c in word_c or word_c [ c ] > board_c [ c ] : return False r , c = len ( board ) , len ( board [ 0 ] ) self . direct = [ ( - 1 , 0 ) , ( 0 , 1 ) , ( 1 , 0 ) , ( 0 , - 1 ) ] for i in range ( r ) : for j in range ( c ) : if board [ i ] [ j ] == word [ 0 ] and self . _exist ( board , i , j , word , 0 ) : return True return False