摘要: 相关问题: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 阅读全文
posted @ 2021-04-16 18:55 habibah_chang 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 相关问题:496. Next Greater Element I 问题: 给定按照日期推移的每日温度列表。 求每一天,距离下一个更暖和的日子还需要的天数。 For example, given the list of temperatures T = [73, 74, 75, 71, 69, 72, 阅读全文
posted @ 2021-04-16 16:47 habibah_chang 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 相关问题:496. Next Greater Element I 问题: 给定数组num,对于每个元素求下一个更大的元素。 下一个的定义:右边 且 若到末尾元素,循环从index=0开始继续向右。 Example 1: Input: nums = [1,2,1] Output: [2,-1,2] E 阅读全文
posted @ 2021-04-16 15:48 habibah_chang 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定数组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, 阅读全文
posted @ 2021-04-16 15:26 habibah_chang 阅读(38) 评论(0) 推荐(0) 编辑