
208. Implement Trie (Prefix Tree)
·
Algorithm
Implement Trie (Prefix Tree) - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. Trie 자료구조 구현 class Trie: def __init__(self): self.head = Node() def insert(self, word: str) -> None: cur = self.head for char in word: if char not in cur.child: new_node = Node(char) cur.child[char] =..