摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the ... 阅读全文
posted @ 2017-07-31 23:05 xiejunzhao 阅读(236) 评论(0) 推荐(0)
摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5)... 阅读全文
posted @ 2017-07-31 23:05 xiejunzhao 阅读(301) 评论(0) 推荐(0)