Search
⌘K
Get Premium
Leetcode 677. Map Sum Pairs
Support insert(key, val) (overwriting existing keys) and sum(prefix) that returns the total of values for all keys starting with that prefix. The core challenge is maintaining up-to-date prefix sums under inserts/overwrites so queries run efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.