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


Runtime: 0 ms, faster than 100.00% of Go online submissions for Map Sum Pairs.
Memory Usage: 2.7 MB, less than 63.36% of Go online submissions for Map Sum Pairs.


```go
type MapSum struct {
	theMap map[string]int
}


/** Initialize your data structure here. */
func Constructor() MapSum {
	//6:55
	return MapSum{theMap: make(map[string]int, 0)}
	//6:58
}


func (this *MapSum) Insert(key string, val int)  {
	this.theMap[key] = val
}


func (this *MapSum) Sum(prefix string) int {
    prefix_length := len(prefix)
	result := 0
	for key, value := range this.theMap {
        if len(key) >= prefix_length {
            if (key[:prefix_length] == prefix) {
                result += value
            }
        }
	}
	return result
}
```
