Merge pull request #63 from Simonhancrew/master

添加0027.移除元素 Python3版本
This commit is contained in:
Carl Sun
2021-05-13 17:37:43 +08:00
committed by GitHub

View File

@ -124,9 +124,19 @@ public:
Java
Python
```python
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
i,n = 0,len(nums)
for j in range(n):
if nums[j] != val:
nums[i] = nums[j]
i += 1
return i
```
Go
```go