int removeDuplicates(int* nums, int numsSize) {
int i = 0;
if(numsSize > 1)
{
for(int j = 0; j <= numsSize  1; j++)
{
if(nums[i] != nums[j])
{
nums[i] = nums[j];
i++;
}
}
return i;
}
else if (numsSize = 0)
{
return 0;
}
else if (numsSize = 1)
{
return 1;
}
}
Could anyone tell me what is worong with that C coding?

should skip the first element
else if (numsSize = 0) and else if (numsSize = 1) should use ==corret answer should be like this
int removeDuplicates(int* nums, int numsSize) { if (numsSize == 0) return 0; int i = 1; if(numsSize > 1) { for(int j = 1; j <= numsSize  1; j++) { if(nums[i  1] != nums[j]) { nums[i] = nums[j]; i++; } } } return i; }

@wangzhw New users please
read the instructions
to format your code properly, please. Thank you!