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.
CVPR 2020 論文大盤點-光流篇
2.
Photoshop教程_ps中怎麼載入圖案?PS圖案如何導入?
3.
org.pentaho.di.core.exception.KettleDatabaseException:Error occurred while trying to connect to the
4.
SonarQube Scanner execution execution Error --- Failed to upload report - 500: An error has occurred
5.
idea 導入源碼包
6.
python學習 day2——基礎學習
7.
3D將是頁遊市場新賽道?
8.
osg--交互
9.
OSG-交互
10.
Idea、spring boot 圖片(pgn顯示、jpg不顯示)解決方案
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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
>>更多相關文章<<