DIY: Snapshot Array
Explore how to implement the SnapShotArray class in C# with methods for setting values, taking snapshots, and retrieving past values by snapshot ID. Understand a practical data structure used to track changes over time, helping you develop problem-solving skills applicable to coding interviews.
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. -
setValue(idx,val)...