DIY: Snapshot Array
Explore how to implement a SnapshotArray with index-based setting, snapshot capturing, and retrieving values by snapshot ID. Understand the core methods to confidently solve related coding interview challenges.
We'll cover the following...
We'll cover the following...
Problem statement
In this challenge, you have to implement a SnapshotArray with the following properties:
-
SnapshotArray(length): This property initializes a data structure withlengthnumber of indexes. Initially, the value at each index is0. -
set_value(idx,val)...