码迷,mamicode.com
首页 >  
搜索关键字:subarray    ( 846个结果
【leetcode】1043. Partition Array for Maximum Sum
题目如下: Given an integer array A, you partition the array into (contiguous) subarrays of length at most K. After partitioning, each subarray has their v ...
分类:其他好文   时间:2019-06-18 14:13:25    阅读次数:115
LeetCode-209 Minimum Size Subarray Sum
题目描述 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 i ...
分类:其他好文   时间:2019-06-13 15:35:07    阅读次数:85
Leetcode 53 最大子串和
给定数列 nums dp[i] ——以nums[i]为结尾的子串的最大和 *** 开始:dp[0]=nums[0] 状态转移:dp[i] = max( dp[i-1]+nums[i],nums[i] ) ...
分类:其他好文   时间:2019-06-06 21:13:38    阅读次数:97
[LeetCode] 898. Bitwise ORs of Subarrays 子数组按位或操作
We have an array of non negative integers. For every (contiguous) subarray (with?`i Github 同步地址: 参考资料: "LeetCode All in One 题目讲解汇总(持续更新中...)" ...
分类:编程语言   时间:2019-06-06 00:27:39    阅读次数:249
LeetCode-209.Minimum Size Subarray Sum
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-06-04 22:07:27    阅读次数:101
560. Subarray Sum Equals K
一、题目 1、审题 2、分析 给定一个整形数组。若存在连续的序列相加和为 k ,统计这样的序列的个数。 二、解答 方法一、 时间复杂度: O(N^2),空间复杂度:O(1) ① 将所给数组 nums,连续元素相加。 nums[i] 代表下标 i 及i之前的元素之和。 ② 采用 count 记录满足的 ...
分类:其他好文   时间:2019-05-28 12:47:22    阅读次数:80
53. Maximum Subarray
53. Maximum Subarray 1 题目 Given an integer array , find the contiguous subarray (containing at least one number) which has the largest sum and return ...
分类:其他好文   时间:2019-05-26 00:30:53    阅读次数:116
LeetCode 718. 最长重复子数组(Maximum Length of Repeated Subarray)
718. 最长重复子数组 718. Maximum Length of Repeated Subarray 题目描述 给定一个含有 n 个正整数的数组和一个正整数 s ,找出该数组中满足其和 ≥ s 的长度最小的连续子数组。如果不存在符合条件的连续子数组,返回 0。 LeetCode718. Max ...
分类:编程语言   时间:2019-05-26 00:27:43    阅读次数:153
LeetCode 581. 最短无序连续子数组(Shortest Unsorted Continuous Subarray)
581. 最短无序连续子数组 581. Shortest Unsorted Continuous Subarray 题目描述 给定一个整型数组,你需要寻找一个 连续的子数组 ,如果对这个子数组进行升序排序,那么整个数组都会变为升序排序。 你找到的子数组应是 最短的 ,请输出它的长度。 LeetCod ...
分类:编程语言   时间:2019-05-21 14:40:17    阅读次数:177
846条   上一页 1 ... 13 14 15 16 17 ... 85 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!