Class Tree
-
- All Implemented Interfaces:
public final class Tree212 - Word Search II\.
Hard
Given an
m x nboardof characters and a list of stringswords, return all words on the board.Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
Example 1:
Input: board = \[\["o","a","a","n"],"e","t","a","e","i","h","k","r","i","f","l","v"], words = "oath","pea","eat","rain"
Output: "eat","oath"
Example 2:
Input: board = \[\["a","b"],"c","d"], words = "abcb"
Output: []
Constraints:
m == board.lengthn == board[i].length1 <= m, n <= 12board[i][j]is a lowercase English letter.<code>1 <= words.length <= 3 * 10<sup>4</sup></code>
1 <= words[i].length <= 10words[i]consists of lowercase English letters.All the strings of
wordsare unique.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTree.Companion
-
Field Summary
Fields Modifier and Type Field Description private Stringendpublic final static Tree.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description Tree()
-