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.
不要想著把數(shù)原封不動(dòng)的顛倒順序织中, 只要在返回長(zhǎng)度范圍內(nèi)的數(shù)組是對(duì)的引镊, 后面的值無(wú)所謂