摘要:
类似问题:232. Implement Queue using Stacks 问题: 设计数据结构,使用queue实现stack。 实现以下功能: void push(int x) Pushes element x to the top of the stack. int pop() Removes 阅读全文
摘要:
问题: 设计数据结构,使用stack实现queue。 实现以下功能: void push(int x) Pushes element x to the back of the queue. int pop() Removes the element from the front of the que 阅读全文
摘要:
问题: 给定二维数组, 求其中子矩形中元素和不大于K 的最大和。 Example 1: Input: matrix = [[1,0,1],[0,-2,3]], k = 2 Output: 2 Explanation: Because the sum of the blue rectangle [[0 阅读全文
摘要:
相关问题:496. Next Greater Element I 问题: 给定一个数组,和一个大小为k的滑动窗口, 求窗口范围内的最大值依次是多少。 Example 1: Input: nums = [1,3,-1,-3,5,3,6,7], k = 3 Output: [3,3,5,5,6,7] E 阅读全文
摘要:
相关问题:496. Next Greater Element I 问题: 给定按照日期推移的每日温度列表。 求每一天,距离下一个更暖和的日子还需要的天数。 For example, given the list of temperatures T = [73, 74, 75, 71, 69, 72, 阅读全文
摘要:
相关问题:496. Next Greater Element I 问题: 给定数组num,对于每个元素求下一个更大的元素。 下一个的定义:右边 且 若到末尾元素,循环从index=0开始继续向右。 Example 1: Input: nums = [1,2,1] Output: [2,-1,2] E 阅读全文
摘要:
问题: 给定数组num2, 求num1中各数右边第一个大于它的数。 Example 1: Input: nums1 = [4,1,2], nums2 = [1,3,4,2] Output: [-1,3,-1] Explanation: For number 4 in the first array, 阅读全文