码迷,mamicode.com
首页 >  
搜索关键字:subarray    ( 846个结果
leetcode: Continuous Subarray Sum
Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that ...
分类:其他好文   时间:2017-10-02 15:21:59    阅读次数:152
C#编程(三十四)----------数组作为参数
原文链接: http://blog.csdn.net/shanyongxu/article/details/46765267 数组作为参数 数组可以作为参数传递给方法,也可以从方法中返回.要返回一个数组,只需要把数组声明为返回类型. static void Main(string[] args) { ...
分类:编程语言   时间:2017-09-27 17:43:18    阅读次数:219
LeetCode 548. Split Array with Equal Sum (分割数组使得子数组的和都相同)$
Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions: where we define that subarray ( ...
分类:编程语言   时间:2017-09-27 11:28:47    阅读次数:216
leetcode - 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 ...
分类:其他好文   时间:2017-09-27 10:06:37    阅读次数:152
LeetCode 53. Maximum Subarray
https://leetcode.com/problems/maximum-subarray/description/ Find the contiguous subarray within an array (containing at least one number) which has th ...
分类:其他好文   时间:2017-09-22 00:40:13    阅读次数:219
Maximum Subarray
这道题为简单题 题目: 思路: 遍历列表,找到局部最优m和全局最优n 代码: ...
分类:其他好文   时间:2017-09-22 00:40:06    阅读次数:186
Maximum Average Subarray I
这道题为简单题 题目: 思路: 我先把前k个数加起来计算平均值,然后遍历列表从索引(k, len(nums)),每次列表向右移动一次就把最左边的的元素减去再加上最新的这个元素,计算总值再求平均值,并与之前的最大值比较,遍历结束后可得最大值。 代码: ...
分类:其他好文   时间:2017-09-21 18:02:16    阅读次数:137
LeetCode Maximum Average Subarray I
原题链接在这里:https://leetcode.com/problems/maximum-average-subarray-i/description/ 题目: Given an array consisting of n integers, find the contiguous subarra ...
分类:其他好文   时间:2017-09-18 14:48:15    阅读次数:148
【Divide and Conquer】53.Maximum Subarray(easy)
#week2# #from leetcode# Description Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For examp ...
分类:其他好文   时间:2017-09-18 00:18:48    阅读次数:259
643. Maximum Average Subarray I
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the ...
分类:其他好文   时间:2017-09-17 16:27:05    阅读次数:116
846条   上一页 1 ... 32 33 34 35 36 ... 85 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!