- 要求数组原地改变,用快慢指针。快指针是当前遍历的位置,慢指针是处理之后数组位置,数组长度有慢指针决定。
推算一遍example,确定逻辑。
26. Remove Duplicates from Sorted Array
Example 1:
Given nums = [1,1,2],
Your function should return length =
26. Remove Duplicates from Sorted Array
Example 1:
Given nums = [1,1,2],
Your function should return length =