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.
說說Python中的垃圾回收機制?
2.
螞蟻金服面試分享,阿里的offer真的不難,3位朋友全部offer
3.
Spring Boot (三十一)——自定義歡迎頁及favicon
4.
Spring Boot核心架構
5.
IDEA創建maven web工程
6.
在IDEA中利用maven創建java項目和web項目
7.
myeclipse新導入項目基本配置
8.
zkdash的安裝和配置
9.
什麼情況下會導致Python內存溢出?要如何處理?
10.
CentoOS7下vim輸入中文
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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
>>更多相關文章<<