leetcode26_刪除排序數組中的重複項_快慢指針

1. 這種題目一眼就是快慢指針問題, 原地修改數組.數組 class Solution { public: int removeDuplicates(vector<int>& nums) { //邊界狀況. if(nums.size()<=1) return nums.size(); //定義快慢指針. int slow=0,
相關文章
相關標籤/搜索