Untitled
class Solution { public: int removeDuplicates(vector<int>& nums) { int length = nums.size(); for (int i = 0; i < length; i++){ if (nums[i] == nums[i+1]) { int removeMiddle(nums, i ,length); } else{ continue; } int removeMiddle(vector<int>& arr, int i,int length){ for(i = i+1; index<length , index++ ){ arr[index-1] = arr[index]; int k = length; return k; } } } } };
Leave a Comment