Code RoomWord search board
HardPrep Room Coding #1161

Word search board

CodingAlgorithms & data structuresSenior–Staff~35 min

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.

Implement
find_words(board: list[list[str]], words: list[str]) → list[str]
Examples
in[[["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]],["oath","pea","eat","rain"]]out["eat","oath"]
What a strong answer looks like

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.

0:00 of about 35 min
InputExpectedGot
[[["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]],["oath","pea","eat","rain"]]["eat","oath"]not run yetsample