赞
踩
题目:
题解:
- int removeElement(int* nums, int numsSize, int val) {
- int left = 0, right = numsSize;
- while (left < right) {
- if (nums[left] == val) {
- nums[left] = nums[right - 1];
- right--;
- } else {
- left++;
- }
- }
- return left;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。