Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 70 爬楼梯删去复杂度的内联公式符 #2846

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions problems/0070.爬楼梯.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public:
};
```

* 时间复杂度:$O(n)$
* 空间复杂度:$O(n)$
* 时间复杂度:O(n)
* 空间复杂度:O(n)

当然依然也可以,优化一下空间复杂度,代码如下:

Expand All @@ -154,8 +154,8 @@ public:
};
```

* 时间复杂度:$O(n)$
* 空间复杂度:$O(1)$
* 时间复杂度:O(n)
* 空间复杂度:O(1)

后面将讲解的很多动规的题目其实都是当前状态依赖前两个,或者前三个状态,都可以做空间上的优化,**但我个人认为面试中能写出版本一就够了哈,清晰明了,如果面试官要求进一步优化空间的话,我们再去优化**。

Expand Down Expand Up @@ -524,3 +524,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

3 changes: 2 additions & 1 deletion problems/0518.零钱兑换II.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ object Solution {
}
}
```
## C
### C

```c
int change(int amount, int* coins, int coinsSize) {
Expand Down Expand Up @@ -444,3 +444,4 @@ public class Solution
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>