diff --git a/problems/0035.搜索插入位置.md b/problems/0035.搜索插入位置.md index e891e3c5..a8da3045 100644 --- a/problems/0035.搜索插入位置.md +++ b/problems/0035.搜索插入位置.md @@ -76,7 +76,7 @@ public: ``` 时间复杂度:O(n) -时间复杂度:O(1) +空间复杂度:O(1) 效率如下: @@ -158,7 +158,7 @@ public: **大家要仔细看注释,思考为什么要写while (left < right), 为什么要写right = middle**。 -``` +```cpp class Solution { public: int searchInsert(vector& nums, int target) { diff --git a/problems/0070.爬楼梯完全背包版本.md b/problems/0070.爬楼梯完全背包版本.md index d6b12450..f92e6716 100644 --- a/problems/0070.爬楼梯完全背包版本.md +++ b/problems/0070.爬楼梯完全背包版本.md @@ -88,7 +88,8 @@ 以上分析完毕,C++代码如下: -``` + +```cpp class Solution { public: int climbStairs(int n) {