Best Time to Buy and Sell Stock II
来源:互联网 发布:互通商城 软件靠谱吗 编辑:程序博客网 时间:2024/06/17 17:34
我就是一只勤劳的小蜜蜂啊O(∩_∩)O哈哈~
木有测试用例很容易理解错误题意滴。。。
public class Solution { public int maxProfit(int[] prices) { int profit = 0; int pre = 0; for(int i = 1; i < prices.length; i++){ if(prices[i] > prices[pre]){ profit += prices[i] - prices[pre]; } pre = i; } return profit; }}
0 0
- [LeetCode]Best Time to Buy and Sell Stock II
- LeetCode Best Time to Buy and Sell Stock II
- Leetcode: Best Time to Buy and Sell Stock II
- [Leetcode] Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock II
- LeetCode : Best Time to Buy and Sell Stock II
- LeetCode Best Time to Buy and Sell Stock II
- [LeetCode] Best Time to Buy and Sell Stock II
- leetcode 61: Best Time to Buy and Sell Stock II
- [LeetCode] Best time to buy and sell a stock II
- Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock II
- 【leetcode】Best Time to Buy and Sell Stock II
- LeetCode - Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock II
- LeetCode之Best Time to Buy and Sell Stock II
- [LeetCode]Best Time to Buy and Sell Stock II
- Minimum Path Sum
- xxxx
- 并行博弈树搜索算法-第1篇 什么是博弈树搜索算法
- C++之STL(二):实现简单容器模板类Vec(vector capacity 增长问题、allocator 内存分配器)
- linux线程实现机制分析----------转自IBM中国开发者社区
- Best Time to Buy and Sell Stock II
- iOS 打电话Demo
- Linux线程学习(一)
- 20140911 N2
- 开天辟地--博客开篇
- buy fifa coins yqomaa vgd seev
- CSS禁止鼠标拖动选择文字
- 在QT中采用多线程下载文件
- 籽做姿祝棕驻ikmhsg籽做姿祝棕驻