Word Search

Given a board of letters and a target word, return true when word can be built by walking through adjacent cells of the board. Adjacent means sharing a horizontal or vertical edge. A cell may be used at most once in a single walk, so the path cannot reuse or revisit a cell.

Each board row is one string, and board[r][c] is the letter in row r and column c.

Examples
Input: [["ABCE","SFCS","ADEE"],"ABCCED"]
Output: true
Hints
Related Problems

Word Search

Given a board of letters and a target `word`, return `true` when `word` can be built by walking through adjacent cells of the board. Adjacent means sharing a horizontal or vertical edge. A cell may be used at most once in a single walk, so the path cannot reuse or revisit a cell.