码迷,mamicode.com
首页 >  
搜索关键字:subarray    ( 846个结果
LeetCode算法题-Shortest Unsorted Continuous Subarray(Java实现)
这是悦乐书的第 267 次更新,第 281 篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第134题(顺位题号是581)。给定一个整数数组,找到一个连续的子数组,按升序对该子数组进行排序,使得整个数组也按升序排序。找到最短的无序连续子数组并输出其长度。例如: 输入:[2 ...
分类:编程语言   时间:2019-03-05 09:23:07    阅读次数:154
[LeetCode] 1004. Max Consecutive Ones III
Given an array A of 0s and 1s, we may change up to K values from 0 to 1. Return the length of the longest (contiguous) subarray that contains only 1s. ...
分类:其他好文   时间:2019-03-04 09:50:29    阅读次数:92
[LeetCode] Longest Mountain in Array 数组中最长的山
Let's call any (contiguous) subarray B (of A) a mountain if the following properties hold: B.length >= 3 There exists some 0 < i < B.length - 1 such t ...
分类:编程语言   时间:2019-03-02 01:08:18    阅读次数:221
LeetCode 209. 长度最小的子数组(Minimum Size Subarray Sum)
题目描述 给定一个含有 n 个正整数的数组和一个正整数 s ,找出该数组中满足其和 ≥ s 的长度最小的连续子数组。如果不存在符合条件的连续子数组,返回 0。 示例: 解题思路 记录当前的连续子数组和,若大于等于s,则以当前子数组的最左端为基准向后遍历,若去掉此数后当前连续子数组和仍大于等于s,就把 ...
分类:编程语言   时间:2019-03-01 15:30:01    阅读次数:221
【LeetCode】双指针 two_pointers(共47题)
https://leetcode.com/tag/two-pointers/ ...
分类:其他好文   时间:2019-02-27 01:26:41    阅读次数:164
Maximum Size Subarray Sum Equals k LT325
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Note:The sum of ...
分类:其他好文   时间:2019-02-24 10:27:27    阅读次数:124
Maximum Product Subarray LT152
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: I ...
分类:其他好文   时间:2019-02-24 10:25:23    阅读次数:185
Minimum Size Subarray Sum LT209
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't ...
分类:其他好文   时间:2019-02-24 10:23:35    阅读次数:121
(C++練習) 53. Maximum Subarray
題目 : Given an integer array nums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum. Example:I ...
分类:编程语言   时间:2019-02-23 01:11:32    阅读次数:263
Shortest Unsorted Continuous Subarray LT581
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be ...
分类:其他好文   时间:2019-02-20 09:28:13    阅读次数:114
846条   上一页 1 ... 16 17 18 19 20 ... 85 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!