Design a counter that supports updating counts for string keys and querying them efficiently.
Implement a counter data structure that stores integer counts for string keys.
Support operations to:
The counter should behave like a mutable in-memory frequency table.
A sequence of operations on a counter object, each operating on a string key.
Return the result of each query operation, and keep internal state updated after each modification.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.