Backend Engineering
Mid
programming
LeetCode #208 - Implement Trie (Prefix Tree)\nImplement a trie with insert, search, and startsWith methods. A trie (pronounced as 'try') is a special data structure used to store a dynamic set or associative array where the keys are usually strings. It is a tree-like data structure where each node represents a character of the string.\n\n**Example**:\n**Input**: \n"insert" - "apple" \n"search" - "apple" \n"search" - "app" \n"startsWith" - "app" \n"insert" - "app" \n"search" - "app" \n\n**Output**: \ntrue \nfalse \ntrue \ntrue \n\n**Constraints**: \n1. All inputs are lowercase letters a-z. \n2. The inputs are strings of at most 200 characters. \n3. The maximum number of inserts in the trie is 10000.
Suggested Answer