快慢指针
数组-快慢指针
我是真不会写代码啊
python是工作,java是生活。
展开
-
3. 283 移动零(easy)
题目:704 Binary Search(easy)一、题目二、 思路二、自己写的1.代码三、标准答案1.方法一(快慢指针)2.总结 一、题目 Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of原创 2022-04-18 14:49:51 · 138 阅读 · 0 评论 -
2. 26删除有序数组中的重复项(easy)
题目:26删除有序数组中的重复项(easy)一、题目二、 思路二、自己写的1.代码三、标准答案1.方法一(快慢指针)2.总结 一、题目 Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kep原创 2022-04-18 14:16:57 · 65 阅读 · 0 评论 -
1. 27 移除元素(easy)
题目:27 移除元素(easy)一、题目二、 思路二、自己写的1.代码三、标准答案1.方法一(快慢指针)3.总结 一、题目 Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed. Since it is impossible to change the length of原创 2022-04-18 14:08:22 · 216 阅读 · 0 评论