Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

DIY: Snapshot Array

Sumit Rawal answered on May 24, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


DIY: Snapshot Array

0

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

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

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

snap: This property takes no parameters and returns the snapid. snapid is the number of times that the snapshot function was called minus 1.

get(idx,snapid) function returns the value at the index idx with the given snapid. 

Popularity 1/10 Helpfulness 1/10 Language whatever
Source: Grepper
Link to this answer
Share Copy Link
Contributed on May 24 2023
Sumit Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.