The Codetikki scribes store massive glyph arrays, but most entries are zero. They need a space-efficient data structure that only stores non-zero values. Implement a sparse array supporting init (with size), set(i, val), and get(i). Input: first line size and number of operations m, then m lines each like "set i v" or "get i". Output: results of get operations, one per line (0 if not set).
Example 1:
Example 2:
Constraints:
1 <= size <= 10^9 1 <= m <= 10^5 0 <= i < size -10^9 <= v <= 10^9
Tags:
