摘要:
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should return length =5, and A is now[1,1,2,2,3].Code:class Solution {public: int removeDuplicates(int A[], int n) { if(n<3) return n; int i=0;... 阅读全文