Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Design Add and Search Words

Medium Trie

Design a structure supporting addWord w and search w, where a search word may contain '.' that matches any single letter. Print true/false for each search.

Constraints

1 <= q <= 10^4 1 <= len(w) <= 25 Lowercase letters and '.' (search only)

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.