
七月在线学习笔记
MD_
不拼一下 你怎么知道你不会成功!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Maximum Subarray
问题描述:给定数组a[1……n],求最大子数组之和。即找出K=i<=j<=n,使得a[i]+……+a[j]之和最大 解法一:暴力枚举:三重循环 代码如下:int maxSubArray(vector<int>& nums) { int n=nums.size(); int ans=nums[0]; for(int i=0;i<n;i++原创 2017-02-19 16:38:09 · 264 阅读 · 0 评论 -
七月在线学习笔记第一课
第一题 LeetCode121 Best Time to Buy and Sell Stock 题目描述 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transact...原创 2019-04-27 19:43:14 · 324 阅读 · 0 评论