美文网首页
80. Remove Duplicates from Sorte

80. Remove Duplicates from Sorte

作者: 我是你的果果呀 | 来源:发表于2016-12-27 08:04 被阅读0次

Follow up for "Remove Duplicates":  What if duplicates are allowed at mosttwice?
For example, 
Given sorted arraynums=[1,1,1,2,2,3],
Your function should return length =5, with the first five elements ofnumsbeing1,1,2,2and3. It doesn't matter what you leave beyond the new length.

不要想着把数原封不动的颠倒顺序, 只要在返回长度范围内的数组是对的, 后面的值无所谓

相关文章

网友评论

      本文标题:80. Remove Duplicates from Sorte

      本文链接:https://www.haomeiwen.com/subject/eppsvttx.html