Find every listed word on a letter board

Write codeHard35 minAmazon and Google style

Your task

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.

Examples

find_words(board: list[list[str]], words: list[str]) -> list[str]
Example 1
Inputfind_words([["o", "a", "a", "n"], ["e", "t", "a", "e"], ["i", "h", "k", "r"], ["i", "f", "l", "v"]], ["oath", "pea", "eat", "rain"])
Output["eat", "oath"]