随笔分类 -  数组

摘要:Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 阅读全文
posted @ 2019-04-11 11:17 MarkLeeBYR 阅读(84) 评论(0) 推荐(0) 编辑
摘要:Input: [0,1,2,4,5,7] Output: ["0->2","4->5","7"] Explanation: 0,1,2 form a continuous range; 4,5 form a continuous range. class Solution { public List 阅读全文
posted @ 2019-04-11 11:16 MarkLeeBYR 阅读(93) 评论(0) 推荐(0) 编辑
摘要:A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2019-04-11 10:55 MarkLeeBYR 阅读(102) 评论(0) 推荐(0) 编辑