Enumerate candidate paths through DFS with in-place character masking: mutate board[r][c] = '#' to prevent cycle reuse, recurse through neighbors, and strictly restore board[r][c] = temp upon unwind.
board[r][c] = '#' eliminates cycles in $O(1)$ space. Every branch MUST guarantee unwinding back to board[r][c] = originalChar to preserve grid integrity.
"Instead of allocating an $O(mn)$ boolean array or re-instantiating state, I mutate board[r][c] = '#' (or XOR with 256) before branching, and restore the original char upon return. This uses $O(1)$ extra heap space."
"Every cell marked as visited MUST be unconditionally restored during recursion unwind. Even when all 4 cardinal directions fail, restoring the cell allows alternate valid paths to traverse through it."
"From the starting letter, we branch up to 4 ways. For all subsequent letters $k \ge 1$, we cannot revisit our parent cell, so the branching factor is at most 3. Worst-case time is $O(M \cdot N \cdot 3^L)$ where $L$ is word length; stack space is $O(L)$."
"Before searching, verify character counts in the board. If the word's tail character occurs less frequently than its head, reversing the word prunes the search tree exponentially earlier!"