[LeetCode] 211. Design Add and Search Words Data Structure, Medium
·
CodingTest/LeetCode
1. 문제요구 사항에 맞는 WordDictionary class를 구현하라.2. 해결class TrieNode { children: Map; isEnd: boolean constructor() { this.children = new Map(); this.isEnd = false; }}class WordDictionary { root: TrieNode; constructor() { this.root = new TrieNode(); } addWord(word: string): void { let node = this.root; for(const char of word) { ..