Question
Given an m x n board of lowercase letters and a list of words, return all words from the list that can be formed by a sequence of adjacent cells (horizontally or vertically neighboring). The same cell may not be used more than once within a single word. Return the found words sorted lexicographically. Board dimensions are at most 12 x 12 and there are at most 100 words, each of length at most 10.
find_words(board: list[list[str]], words: list[str]) → list[str][[["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]],["oath","pea","eat","rain"]]out["eat","oath"]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.