首页
技术
登录
6mi
u
盘
搜
搜 索
技术
LeetCode26:删除排序数组中的重复项
LeetCode26:删除排序数组中的重复项
技术
2022-07-17
70
class Solution { public int removeDuplicates(int[] nums) { int i = 0; int j = 1; while(j < nums.length){ while(nums[j]!= nums[i]){ nums[i+1] = nums[j]; i++; } j++; } return i+1; } }
转载请注明原文地址:https://ipadbbs.8miu.com/read-28740.html
最新回复
(
0
)