Package g0201_0300.s0212_word_search_ii
Class Tree
java.lang.Object
g0201_0300.s0212_word_search_ii.Tree
212 - Word Search II.<p>Hard</p>
<p>Given an <code>m x n</code> <code>board</code> of characters and a list of strings <code>words</code>, return <em>all words on the board</em>.</p>
<p>Each word must be constructed from letters of sequentially adjacent cells, where <strong>adjacent cells</strong> are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.</p>
<p><strong>Example 1:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2020/11/07/search1.jpg" alt="" /></p>
<p><strong>Input:</strong> board = [[“o”,“a”,“a”,“n”],[“e”,“t”,“a”,“e”],[“i”,“h”,“k”,“r”],[“i”,“f”,“l”,“v”]], words = [“oath”,“pea”,“eat”,“rain”]</p>
<p><strong>Output:</strong> [“eat”,“oath”]</p>
<p><strong>Example 2:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2020/11/07/search2.jpg" alt="" /></p>
<p><strong>Input:</strong> board = [[“a”,“b”],[“c”,“d”]], words = [“abcb”]</p>
<p><strong>Output:</strong> []</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>m == board.length</code></li>
<li><code>n == board[i].length</code></li>
<li><code>1 <= m, n <= 12</code></li>
<li><code>board[i][j]</code> is a lowercase English letter.</li>
<li><code>1 <= words.length <= 3 * 10<sup>4</sup></code></li>
<li><code>1 <= words[i].length <= 10</code></li>
<li><code>words[i]</code> consists of lowercase English letters.</li>
<li>All the strings of <code>words</code> are unique.</li>
</ul>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
end
-
-
Constructor Details
-
Tree
public Tree()
-
-
Method Details
-
getChild
-
len
public int len() -
addWord
-
deleteWord
-