Problem
You get an m x n grid of letters board and a list of strings words. Return all the strings in words that you can find on the board.
To make a word, start at one cell and move to an adjacent cell for each next letter. Two cells are adjacent when they share a side. Thus, a cell has at most four adjacent cells.
A word cannot use the same cell more than one time. You can return the words in any order.
Example 1
- Input:
- board = [["s","e","a"],["t","o","n"],["r","i","p"]], words = ["sea","ton","stop","rip","nap"]
- Output:
- ["sea","ton","rip"]
- Explanation:
- For
stop, the paths,t,oexists, but no cell adjacent toohas the letterp.
Example 2
- Input:
- board = [["x","y"],["z","w"]], words = ["xyx"]
- Output:
- []
- Explanation:
- The word
xyxneeds the cell withxtwo times, and a word cannot use a cell two times.
Constraints
- m == board.length
- n == board[i].length
- 1 <= m, n <= 12
- board[i][j] is a lowercase English letter.
- 1 <= words.length <= 3 * 10^4
- 1 <= words[i].length <= 10
- words[i] contains only lowercase English letters.
- All the strings of words are unique.
SysRound wrote this statement. A reference solution checks every example.
Related questions
Continue with questions that share topics or the same question type.
- Word Search
Coding · Array · Backtracking · Depth-First Search
- Word Break II
Coding · Array · Backtracking · Dynamic Programming
- Word Break
Coding · Array · Brute-Force Search · Dynamic Programming
- Design Excel Sum Formula
Coding · Array · Design · Graph Theory
Sources · 2 references
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 6 records
Amazon
Leetcode 212. Word Search II
Reported Mar 31, 2025 · 2 source reports
MID_LEVEL
Source snapshot: Nov 12, 2026
View sourceBloomberg
Leetcode 212. Word Search II
Reported Nov 25, 2025 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View sourceGlean
Leetcode 212. Word Search II
Reported Apr 3, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View sourceGoogle
Leetcode 212. Word Search II
Reported Oct 15, 2025 · 2 source reports
INTERN, MID_LEVEL
Source snapshot: Nov 12, 2026
View source