![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Two pointers
Nahida_nora
这个作者很懒,什么都没留下…
展开
-
Leetcode 41. First Missing Positive
Leetcode 41. First Missing Positive算法:Check if 1 is present in the array. If not, you’re done and 1 is the answer. If nums = [1], the answer is 2. Replace negative numbers, zeros, and numbers larger than n by 1s. 检查1是否存在,不存在返回1。如果1存在,且数组只有一个元素,则返回2。把所有0原创 2020-08-03 03:53:19 · 168 阅读 · 0 评论 -
Leetcode 713. Subarray Product Less Than K
Leetcode 713. Subarray Product Less Than KInput: nums = [10, 5, 2, 6], k = 100Output: 8index:0[10], [10, 5], ans = 2index: 1[5], [5,2], [5,2,6], ans = 5index: 2[2], [2, 6], ans = 7index: 3[6], ans =8Approach #2: Sliding Window [Accepted]Input:原创 2020-06-23 00:43:48 · 108 阅读 · 0 评论