You are given a list of operations to execute on an in-memory key-value store.
Supported operations:
- `('put', key, value)`: insert a new key or overwrite an existing key with `value`. If the key already exists, only the value changes; its current hit count is preserved.
- `('get', key)`: if the key exists, return its value and increment its hit count by 1. If it does not exist, return `None` and do not create the key.
- `('delete', key)`: remove the key and its hit count. Return `True` if the key existed and was deleted, otherwise `False`.
- `('getHitCount', key)`: return the current hit count for the key, or `None` if the key does not exist.
Return a list of outputs for every `get`, `delete`, and `getHitCount` operation, in order. `put` does not produce output.
If a key is deleted and later inserted again with `put`, it is treated as a new key and its hit count starts at 0.
Examples
Input: ([('put', 'a', 10), ('get', 'a'), ('get', 'a'), ('getHitCount', 'a')],)
Expected Output: [10, 10, 2]
Explanation: Two successful `get` operations increment the hit count from 0 to 2.
Input: ([('get', 'x'), ('delete', 'x'), ('getHitCount', 'x')],)
Expected Output: [None, False, None]
Explanation: Edge case: missing keys return `None` for `get` and `getHitCount`, and `False` for `delete`.
Input: ([('put', 'a', 1), ('get', 'a'), ('put', 'a', 99), ('getHitCount', 'a'), ('get', 'a'), ('getHitCount', 'a')],)
Expected Output: [1, 1, 99, 2]
Explanation: Overwriting changes the stored value to `99` but preserves the existing hit count.
Input: ([('put', 'k', 5), ('get', 'k'), ('delete', 'k'), ('getHitCount', 'k'), ('put', 'k', 7), ('getHitCount', 'k'), ('get', 'k'), ('getHitCount', 'k')],)
Expected Output: [5, True, None, 0, 7, 1]
Explanation: After deletion, reinserting `k` starts a new hit count at 0.
Input: ([],)
Expected Output: []
Explanation: Edge case: no operations produce no output.