Concept Flow - Count Words with Given Prefix
Start with empty Trie
Insert each word
For each character in word
If char node missing, create it
Move to char node, increment prefix count
After all words inserted
Search prefix
Traverse prefix chars
If prefix node found, return count
Else return 0
Build a Trie by inserting words, counting prefixes at each node, then traverse prefix to get count.
