Search
⌘K

Leetcode 1146. Snapshot Array

Design a versioned array that supports point updates, taking snapshots (returning increasing snap_ids), and querying the value at an index for a given snap_id. The core challenge is to efficiently record per-index change histories (snap_id → value) so get can retrieve the latest value at or before a snap_id (typically via binary search).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.