Word search on board

Write codeHard40 minMicrosoft style

Your task

Given an m x n board of lowercase letters and a single target word, return true if the word can be formed by a path of 4-directionally adjacent cells where each cell is used at most once. The path may start at any cell. The word is non-empty. The board has at least one cell.

Examples

word_exists(board: list[list[str]], word: str) -> bool
Example 1
Inputword_exists([["a", "b", "c", "e"], ["s", "f", "c", "s"], ["a", "d", "e", "e"]], "abcced")
OutputTrue