Concept Flow - Count Words with Given Prefix
Start at root node
For each char in prefix
Check if char child exists?
No→Prefix not found, return 0
Yes
Move to child node
Repeat for next char
After last char
Return count of words with this prefix
Start from the root of the trie and follow each character of the prefix. If any character is missing, return 0. Otherwise, after the last character, return the count of words that share this prefix.