Design an array that can be frozen at any time and read back as it was.
new SnapshotArray(length) - an array of length zerosset(index, value) - change one entrysnap() - freeze the array and return the snapshot id: 0 for the first call, 1 for the second, and so onget(index, snapId) - the value array[index] had when snapshot snapId was taken. snapId is always one that has been returned by snap()- Do not copy the whole array on every
snap(): it should be O(1). set should be O(1) and get O(log v), where v is the number of changes at that index