3
self.child = {} # to hold the nodes.4
self.end = False # to mark a node if it is the end node or not.12
def insert(self, word: str) -> None:13
# time compl len(word)16
temp = self.root # to hold the root node.18
for ind, i in enumerate(word):19
if i in temp.child.keys(): # if this curr char in the current node.20
temp = temp.child[i] # another node.23
temp.child[i] = Node()29
def search(self, word: str) -> bool:33
if i in temp.child.keys():38
return temp.end == True40
def startsWith(self, prefix: str) -> bool:43
if i in temp.child.keys():