diff --git a/problems/0027.移除元素.md b/problems/0027.移除元素.md index 8522e785..dbde3d19 100644 --- a/problems/0027.移除元素.md +++ b/problems/0027.移除元素.md @@ -256,17 +256,24 @@ class Solution: ### Go: ```go +// 快慢指针法 +// 时间复杂度 O(n) +// 空间复杂度 O(1) func removeElement(nums []int, val int) int { - length:=len(nums) - res:=0 - for i:=0;i