https://leetcode.com/problems/map-sum-pairs


Runtime: 28 ms, faster than 85.04% of Python3 online submissions for Map Sum Pairs.
Memory Usage: 14.3 MB, less than 54.69% of Python3 online submissions for Map Sum Pairs.


```python
class MapSum:

    def __init__(self):
        """
        Initialize your data structure here.
        """
        #6:40
        self.map = dict()
        #6:43
        

    def insert(self, key: str, val: int) -> None:
        self.map[key] = val
        

    def sum(self, prefix: str) -> int:
        result = 0
        for each in self.map.keys():
            if (each[:len(prefix)] == prefix):
                result += self.map[each]
        return result
```
