Given a 2D board and a word, find if the word exists in the grid. Letters must be adjacent (horizontal/vertical) and each cell used at most once.
Backtracking on a grid: try each cell as starting point. DFS matching one character at a time. Mark cells as visited and unmark when backtracking.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
exist(board, 'ABCCED')
True