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.
【Java8新特性_尚硅谷】P1_P5
2.
SpringSecurity 基礎應用
3.
SlowFast Networks for Video Recognition
4.
074-enable-right-click
5.
WindowFocusListener窗體焦點監聽器
6.
DNS部署(二)DNS的解析(正向、反向、雙向、郵件解析及域名轉換)
7.
Java基礎(十九)集合(1)集合中主要接口和實現類
8.
瀏覽器工作原理學習筆記
9.
chrome瀏覽器構架學習筆記
10.
eclipse引用sun.misc開頭的類
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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
>>更多相關文章<<