Skip to content

Commit da9689a

Browse files
committed
update
update
1 parent adf7b6e commit da9689a

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

leetcode_array/搜索插入位置.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 搜索插入位置
1+
## 35.搜索插入位置
22
给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。
33
你可以假设数组中无重复元素
44
示例:

leetcode_array/移除元素.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 移除元素
1+
## 27.移除元素
22
给你一个数组 nums 和一个值 val,你需要 原地 移除所有数值等于 val 的元素,并返回移除后数组的新长度。
33

44
不要使用额外的数组空间,你必须仅使用 O(1) 额外空间并 原地 修改输入数组。
@@ -20,6 +20,9 @@
2020
* 当nums[j]不等于目标值的时候,nums[j]复制给nums[i],i递增。
2121
* 时间复杂度O(n),空间复杂度O(1)
2222

23+
![](../pic/leetcode_array/27_1.png)
24+
![](../pic/leetcode_array/27_2.png)
25+
2326
```python
2427
def removeElement(nums, val):
2528
i = 0

pic/leetcode_array/27_1.png

9.23 KB
Loading

pic/leetcode_array/27_2.png

9.62 KB
Loading

0 commit comments

Comments
 (0)