JavaShuo
栏目
标签
LeetCode - Array - Easy - 122
时间 2021-01-11
标签
LeetCode
繁體版
原文
原文链接
思路:这道题目不限制购入次数,只是要求手中只能持有一支股票。那么就想简单一点,只要有利润我就买,怎么看有利润,只要股票前后两天的价格存在正差,我就认为前一天我买了,隔天就卖出去。注意不需要考虑怎么去获得单支股票的最大收益。 class Solution { public: int maxProfit(vector<int>& prices) { int numPro=pri
>>阅读原文<<
相关文章
1.
LeetCode - Array - Easy - 88
2.
LeetCode - Array - Easy - 26
3.
LeetCode--Array--Two sum (Easy)
4.
【leetcode】189.(Easy)Rotate Array
5.
leetcode 88[easy]---Merge Sorted Array
6.
LeetCode Array Easy 485. Max Consecutive Ones
7.
leetcode 697[easy]---Degree of an Array
8.
leetcode easy
9.
leetcode 167[easy]---Two Sum II - Input array is sorted
10.
C# 写 LeetCode easy #26 Remove Duplicates from Sorted Array
更多相关文章...
•
C# Array 类
-
C#教程
•
PHP array() 函数
-
PHP参考手册
•
为了进字节跳动,我精选了29道Java经典算法题,带详细讲解
•
Git可视化极简易教程 — Git GUI使用方法
相关标签/搜索
array@leetcode
LeetCode Easy
array+array
array
easy-
easy
122%
4.array
leetcode
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
排序-堆排序(heapSort)
2.
堆排序(heapSort)
3.
堆排序(HEAPSORT)
4.
SafetyNet简要梳理
5.
中年转行,拥抱互联网(上)
6.
SourceInsight4.0鼠标单击变量 整个文件一样的关键字高亮
7.
游戏建模和室内设计那个未来更有前景?
8.
cloudlet_使用Search Cloudlet为您的搜索添加种类
9.
蓝海创意云丨这3条小建议让编剧大大提高工作效率!
10.
flash动画制作修改教程及超实用的小技巧分享,硕思闪客精灵
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
LeetCode - Array - Easy - 88
2.
LeetCode - Array - Easy - 26
3.
LeetCode--Array--Two sum (Easy)
4.
【leetcode】189.(Easy)Rotate Array
5.
leetcode 88[easy]---Merge Sorted Array
6.
LeetCode Array Easy 485. Max Consecutive Ones
7.
leetcode 697[easy]---Degree of an Array
8.
leetcode easy
9.
leetcode 167[easy]---Two Sum II - Input array is sorted
10.
C# 写 LeetCode easy #26 Remove Duplicates from Sorted Array
>>更多相关文章<<