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 投票数
Article Rating
订阅评论
提醒

0 评论
最新
最旧 最多投票
内联反馈
查看所有评论