Search⌘ K

DIY: Snapshot Array

Explore how to build a SnapshotArray data structure that supports setting values, taking snapshots, and retrieving past values. This lesson helps you develop skills to manage versioned arrays and solve real-world coding problems using Go.

Problem statement

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

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

  • ...