llllmz

导航

2024年9月6日

26. 删除有序数组中的重复项

摘要: class Solution { public: int removeDuplicates(vector<int>& nums) { int head = 0, curIndex = 0, target = INT_MIN; for(; curIndex < nums.size(); ++curIn 阅读全文

posted @ 2024-09-06 21:22 神奇的萝卜丝 阅读(8) 评论(0) 推荐(0)

27. 移除元素

摘要: 像个漏斗一样把元素筛出来就好了。 class Solution { public: int removeElement(vector<int>& nums, int val) { int head = 0, curIndex = 0; for(; curIndex < nums.size(); ++ 阅读全文

posted @ 2024-09-06 21:15 神奇的萝卜丝 阅读(10) 评论(0) 推荐(0)