Given a 2D board of letters and a word, determine if the word exists in the grid by tracing adjacent cells (up/down/left/right) without reuse. Use DFS backtracking.
2D list of chars and target word string.
Boolean.
Example 1:
Input:
board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]] word = "ABCCED"
Output:
true
Example 2:
Input:
board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]] word = "SEE"
Output:
true
Example 3:
Input:
board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]] word = "ABCB"
Output:
false