Implement a time-indexed key-value store in function form. You will receive a list of operations and must process them in order. A `set` operation stores a string value for a string key at a given integer timestamp. A `get` operation asks for the value of a key at the greatest timestamp `t'` such that `t' <= timestamp`. If no such value exists, return an empty string. Your function should return the results of all `get` operations in order.
Examples
Input: [('set', 'foo', 'bar', 1), ('get', 'foo', 1), ('get', 'foo', 3), ('set', 'foo', 'baz', 4), ('get', 'foo', 4), ('get', 'foo', 5)]
Expected Output: ['bar', 'bar', 'baz', 'baz']
Explanation: Gets return the latest value at or before the requested timestamp.
Input: [('get', 'a', 10), ('set', 'a', 'x', 5), ('get', 'a', 4), ('get', 'a', 5)]
Expected Output: ['', '', 'x']
Explanation: The first get has no data, the second is before the first set timestamp, and the third matches timestamp 5.
Input: [('set', 'love', 'high', 10), ('set', 'love', 'low', 20), ('get', 'love', 5), ('get', 'love', 10), ('get', 'love', 15), ('get', 'love', 20), ('get', 'love', 25)]
Expected Output: ['', 'high', 'high', 'low', 'low']
Explanation: Queries before 10 return empty, then the latest value at or before the query time is returned.
Input: [('set', 'a', 'x', 1), ('set', 'b', 'y', 2), ('get', 'b', 1), ('get', 'a', 2), ('get', 'b', 2)]
Expected Output: ['', 'x', 'y']
Explanation: Each key is tracked independently.