Wildcard dictionary search

Write codeMedium25 minMeta style

Your task

Build a dictionary from the list words, then answer a list of search queries. A query is a string that may contain the wildcard character '.', which matches any single letter; a regular letter must match exactly. Return a list of booleans, one per query, indicating whether some word in the dictionary matches the entire query (same length, all positions satisfied). Words and queries contain only lowercase letters and '.'.

Examples

trie_wildcard_search(words: list[str], queries: list[str]) -> list[bool]
Example 1
Inputtrie_wildcard_search(["bad", "dad", "mad"], ["pad", "bad", ".ad", "b.."])
Output[False, True, True, True]