标签:变换 etc ++ public rem 恶心 leetcode return class
一开始各种坐标变换把我绕晕了- -,恶心的水题
class Solution {
public int removeDuplicates(int[] nums) {
if (nums.length == 0) return 0;
int j = 0;
for (int i = 0; i < nums.length; i++)
if (nums[i] != nums[j]) nums[++j] = nums[i];
return ++j;
}
}
标签:变换 etc ++ public rem 恶心 leetcode return class
原文地址:https://www.cnblogs.com/acbingo/p/9256510.html