Search
⌘K

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.

Comments

Your account is free and you can post anonymously if you choose.