Remove elements
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# 数组
|
||||
|
||||
- [二分查找](./bin_search.md)
|
||||
- [移除元素](./remove_elements.md)
|
||||
|
||||
# 经典代码
|
||||
|
||||
|
11
notes/src/remove_elements.md
Normal file
11
notes/src/remove_elements.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 移除元素
|
||||
|
||||
查找数组中的目标元素 target ,原地移除该元素,返回移除后的数组长度。
|
||||
|
||||
双指针法,快指针用于查找新数组的元素,即不是 target 的元素,慢指针用于覆盖,即写入新数组的元素。
|
||||
|
||||
## 相关题目
|
||||
|
||||
- [27. 移除元素](https://leetcode.com/problems/remove-element/)
|
||||
- [24. 删除排序数组中的重复项](https://leetcode.com/problems/swap-nodes-in-pairs/)
|
||||
- [283. 移动零](https://leetcode.com/problems/move-zeroes/)
|
Reference in New Issue
Block a user