Design a data structure that stores words and supports searching with the wildcard . (matches any single letter).
Input: one operation per line —
addWord w — add word wsearch p — print true if any stored word matches pattern p (letters and dots)Output: one line per operation — addWord prints null; search prints true/false.
addWord bad addWord dad addWord mad search pad search bad search .ad search b..
null null null false true true true
Run your code against the sample tests, or Submit to run the full suite.