keshavMM004/InterviewQuest

GOOGLE interview question

オープン

#2 opened on 2024/10/07

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Java (0 件のフォーク)auto 404
hacktoberfest

Repository metrics

Stars
 (0 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Design a SnapshotArray that provides the following functionality:

SnapshotArray(int length): Initializes an array-like structure of the given length, with each element initially set to 0. void set(int index, int val): Updates the element at the specified index to the given value. int snap(): Captures a snapshot of the current state of the array and returns the snap_id, which is the number of times snap() has been called, minus 1. int get(int index, int snap_id): Returns the value at the specified index at the time the snapshot with the given snap_id was taken.

leetcode

コントリビューターガイド