天天看點

LeetCode 27 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.

題目翻譯:給定一個數組A和一個值elem,删除所有的elem,并傳回新的數組長度。元素的順序可以改變。

C語言版:

Python版: