Search⌘ K

DIY: Snapshot Array

Explore how to implement a Snapshot Array in Elixir, complete with initialization, setting values, taking snapshots, and retrieving data. This lesson helps you understand and apply a practical data structure essential for coding interviews.

Problem statement

In this challenge, you have to implement a SnapshotArray with the following properties:

  • init(length): This property initializes a data structure with length number of indexes. Initially, the value at each index is 0.

  • set_value(obj,idx,val): This ...