core practice · coding problem
Word Search
LeetCode #79 — Word Search. Solve on LeetCode, then implement here if you want it in your drill queue. https://leetcode.com/problems/word-search/
The mechanism
Backtracking is "try a choice, recurse, undo if it does not work, try the next one." It explores all possibilities, but you cut whole branches by stopping early when you can prove they will never reach a valid answer.
Expected evidence
Pass all LeetCode test cases for this problem.
Try this drill in the practice workspace →
Hints when you need them
- Pattern hint: backtracking.
- Start with brute force, then optimize time/space.
- Write down invariants before coding.