...

/

Snapshot Array

Snapshot Array

Try to solve the Snapshot Array problem.

Statement

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

  • NewSnapshotArray (length): Initializes the data structure to hold the specified number of indexes.

  • Set Value (idx, val): This property sets the value at a given index idx to value val.

  • Snapshot(): This method takes no parameters and returns the Snap ID. Snap ID is the number of times that the snapshot function was called, less ...

Access this course and 1200+ top-rated courses and projects.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy