← 返回 snowflake 的题目列表String and Graph Problems
类型:online_judge
Question Description
You are given a 2D board of characters and a word. Determine if the word can be found in the grid. The word can be constructed from letters of sequentially adjacent cells, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
Example
Input:
board = [
['A','B','C','E'],
['S','F','C','S'],
['A','D','E','E']
]
word = "ABCCED"
Output:
true
Constraints
Dimensions of board are m x n where 1 <= m, n <= 200
The length of word is between 1 and 10^3
Example
Input
3 4
A B C E
S F C S
A D E E
ABCCED