更新 买卖股票的最佳时机系列 排版格式修复

This commit is contained in:
jinbudaily
2023-07-26 15:55:12 +08:00
parent 89571ea8f8
commit 6b322684a4
7 changed files with 63 additions and 67 deletions

View File

@@ -24,11 +24,9 @@
* 输出0
解释:在这种情况下, 没有交易完成, 所以最大利润为 0。
# 算法公开课
**《代码随想录》算法视频公开课:[动态规划之 LeetCode121.买卖股票的最佳时机1](https://www.bilibili.com/video/BV1Xe4y1u77q),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 算法公开课
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划之 LeetCode121.买卖股票的最佳时机1](https://www.bilibili.com/video/BV1Xe4y1u77q),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -202,7 +200,7 @@ public:
## 其他语言版本
Java:
### Java:
> 贪心法:
@@ -294,8 +292,7 @@ class Solution {
```
Python:
### Python:
> 贪心法:
```python
@@ -351,7 +348,8 @@ class Solution:
return dp1
```
Go:
### Go:
> 贪心法:
```Go
func maxProfit(prices []int) int {
@@ -418,7 +416,7 @@ func max(a, b int) int {
}
```
JavaScript:
### JavaScript:
> 动态规划
@@ -454,7 +452,7 @@ var maxProfit = function(prices) {
};
```
TypeScript
### TypeScript
> 贪心法
@@ -492,7 +490,7 @@ function maxProfit(prices: number[]): number {
};
```
C#
### C#
> 贪心法
@@ -533,7 +531,7 @@ public class Solution
}
```
Rust:
### Rust:
> 贪心