class Solution {public: int removeDuplicates(int A[], int n) { int temp = A[0],j = 0,count; for(int i = 0 ; i < n ;){ count = 0; while(i=2) A[j++] = temp; A[j++] = temp; temp = A[i]; } return j; }};
本文共 346 字,大约阅读时间需要 1 分钟。
class Solution {public: int removeDuplicates(int A[], int n) { int temp = A[0],j = 0,count; for(int i = 0 ; i < n ;){ count = 0; while(i=2) A[j++] = temp; A[j++] = temp; temp = A[i]; } return j; }};
转载于:https://www.cnblogs.com/llei1573/p/4376455.html