[LeetCode] 677. Map Sum Pairs, Medium
·
CodingTest/LeetCode
1. 문제요구사항에 맞는 MapSum class를 구현하라.2. 해결class TrieNode { children: Map; sum: Map; constructor() { this.children = new Map(); this.sum = new Map(); }}class MapSum { root: TrieNode; constructor() { this.root = new TrieNode(); } insert(key: string, val: number): void { let node = this.root; for(const char of key) { if(!..