[Go] Slice & bin search, faster than 96%
\ntype Snapshot struct {\n\tid  int\n\tval int\n}\n\ntype SnapshotsHistory struct {\n\tsnapshots *[]Snapshot\n\tcurrVal   int\n}\n\ntype SnapshotArray struct {\
```\ntype Snapshot struct {\n\tid  int\n\tval int\n}\n\ntype SnapshotsHistory struct {\n\tsnapshots *[]Snapshot\n\tcurrVal   int\n}\n\ntype SnapshotArray struct {\n\tarray      *[]*SnapshotsHistory\n\tsnapshotId int\n}\n\nfunc Constructor(length int) SnapshotArray {\n\tarr := make([]*SnapshotsHistory, length)\n\tres := SnapshotArray{&arr, 0}\n\n\tfor i := 0; i < length; i++ {\n\t\thist := make([]Snapshot, 0)\n\t\t(*res.array)[i] = &SnapshotsHistory{&hist, 0}\n\t}\n\n\treturn res\n}\n\nfunc (this *SnapshotArray) Set(index int, val int) {\n\thist := (*this.array)[index]\n\n\tif this.snapshotId > 0 && (len(*hist.snapshots) == 0 || (*hist.snapshots)[len(*hist.snapshots)-1].id < this.snapshotId) {\n\t\t*hist.snapshots = append(*hist.snapshots, Snapshot{this.snapshotId - 1, hist.currVal})\n\t}\n\n\thist.currVal = val\n}\n\nfunc (this *SnapshotArray) Snap() int {\n\tdefer func() {\n\t\tthis.snapshotId++\n\t}()\n\treturn this.snapshotId\n}\n\nfunc (this *SnapshotArray) Get(index int, snapId int) int {\n\thist := (*this.array)[index]\n\n\tif len(*hist.snapshots) == 0 || (*hist.snapshots)[len(*hist.snapshots)-1].id < snapId {\n\t\treturn hist.currVal\n\t}\n\n\tl := 0\n\tr := len(*hist.snapshots)\n\tm := 0\n\n\tfor l < r {\n\t\tm = (l + r) / 2\n\n\t\tmId := (*hist.snapshots)[m].id\n\n\t\tif m == l && mId >= snapId || m > l && mId >= snapId && (*hist.snapshots)[m-1].id < snapId {\n\t\t\tbreak\n\t\t}\n\n\t\tif mId < snapId {\n\t\t\tl = m + 1\n\t\t} else {\n\t\t\tr = m\n\t\t}\n\t}\n\n\treturn (*hist.snapshots)[m].val\n}\n```
['Go']