Use something like two pointer, a pointer to indicate current position, another to indicate next append position of the new array. Since do not need to actually decrease the length of vector, we just need to told the length of the vector then it will get the length of the vector.
leetcode-26-Remove Duplicates from Sorted Array
最新推荐文章于 2020-11-28 21:12:49 发布