目录

力扣212. 单词搜索 II

力扣212. Word Search II(单词搜索 II)

给定一个 m×n 二维字符网格 board 和一个单词列表 words,返回所有在网格中出现的单词。

示例 1:

../posts/01_学习/87_LeetCode/0212_单词搜索II/img/0212-1-description.png

输入:board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"]
输出:["eat","oath"]

提示:

  • m == board.length
  • n == board[i].length
  • 1 <= m, n <= 12
  • board[i][j] 是一个小写英文字母
  • 1 <= words.length <= 3 * 10^4
  • 1 <= words[i].length <= 10
  • words[i] 由小写英文字母组成
  • words 中的所有字符串互不相同