摘要: 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].思路:这道题与Remove Duplicates from Sorted Array思路差不多吧,就是在记录相等元素的时候有些变化,当相等元素超过两个的时候直接跳过,后面的数不作为记录。class So 阅读全文
posted @ 2014-03-28 23:33 Awy 阅读(105) 评论(0) 推荐(0) 编辑