keshavMM004/InterviewQuest

GOOGLE interview question

開放

#2 建立於 2024年10月7日

 (1 則留言) (0 個反應) (0 位負責人)Java (0 個分叉)auto 404
hacktoberfest

倉庫指標

星標
 (0 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南