Given an m x n board of characters and a list of strings words, 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"]
Explanation: "oath" traces o (0,0) → a (0,1) → t (1,1) → h (2,1), and "eat" traces e (1,3) → a (1,2) → t (1,1). The board has no 'p' for "pea", and "rain" cannot be traced through adjacent cells.
Example 2
Input: board = [["a","b"],["c","d"]], words = ["abcb"]
Output: []
Explanation: "abcb" would need to reuse the single 'b', and 'c' is not even next to 'b'. So no word can be formed.
Example 3
Input: board = [["a"]], words = ["a"]
Output: ["a"]
Explanation: The single cell spells "a".
Put all the words into a trie so a single DFS from each board cell can check many words at once — the DFS only continues down paths that the trie says could still spell a word. When the DFS reaches a trie node marked as a word end, record that word.
Run checks all cases above. Submit evaluates all test cases.