这题居然是 easy... 我怀疑人生了, getMin() 怎么能做到常数时间? Heap 也是 LogN 啊 看了最高票解之后...........天哪, 我可太菜了 核心思想是保证每次 pop 时都能以常数时间更新最小值, 这就需要在空间上以某种方式记录下来 那一种做法就是存储每个元素和最小值之间的差值, 这样 pop 的时候就能不断还原出原始值 另一种更直观的做法就是每次入栈 min 时, 都把前一个 min (当前第二小的数字) 放在它前面, 作为记录 */
source not stored for this graph (policy: none)
nothing calls this directly
no outgoing calls
no test coverage detected