Skip to content

Commit

Permalink
update leetcode
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobinqt committed Aug 16, 2023
1 parent 2c94055 commit fcabdb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion book.leetcode/docs/easy/27.md
Expand Up @@ -80,7 +80,9 @@ func removeElement(nums []int, val int) int {
nums[j-1] = nums[j]
}

i-- // 因为下标i以后的数值都向前移动了一位,所以i也向前移动一位
// 因为下标i以后的数值都向前移动了一位,所以i也向前移动一位
// 因为不知道移动过来的第一位的值是不是 val
i--
length-- // 此时数组的大小-1
}

Expand Down

0 comments on commit fcabdb6

Please sign in to comment.