Letters in a grid can be chained horizontally or vertically (not diagonally), and each cell can be used at most once per word.
Implement:
exists(board, word): whether the word can be traced in the grid, using DFS with backtrackingfind_words(board, words): the sorted list of distinct words from words that appear. Build a trie of the words and run a single DFS from each cell that follows the trie, so the cost doesn't grow with the number of words.board is a list of equal-length strings.