高盛店面挂经

直接上题

Given a queue with operations such as push()and pop() and another attribute named version number which is incremented each time an operation is performed on the queue find the state of the queue at a particular version number without using a lot of memory.

Example:

Input: [[0,1],[0,2],[1],[1],[0,3]], version=3
Output: [2]
Explanation: Version 1: [1], Version 2: [1,2], Version 3: [2], Version 4: [], Version 5: [3]

Format: Push = [0,element], Pop = [1]

没做出来,已挂

这题很像 https://leetcode.com/problems/snapshot-array/

也是谷歌高频题 Google onsite面经

高盛钱少
不值得去
重要的是食堂难吃
最大缺点是高盛要穿西装