LeetCode-27

Links:https://leetcode.com/problems/remove-element/

Given an array and a value, remove all instances of that value in place and return the new length.

The order of elements can be changed. It doesn’t matter what you leave beyond the new length.

 

思路:最快的不是一个个替换,是一次遍历重新做一个Vector替换。

 

【LeetCode】27. Remove Element
Tagged on:
0 0 vote
Article Rating
订阅
提醒
0 评论
Inline Feedbacks
View all comments