Problem 1146 · Medium

Snapshot Array

Store each index as a history of (snapshot id, value) pairs and binary search the newest entry for a requested snapshot.

Open the interactive visualisation