Skip to content

Instantly share code, notes, and snippets.

@Howard-Chang
Created July 24, 2018 11:03
Show Gist options
  • Save Howard-Chang/f0fabe67b4114e98d0429bbf5935ca3c to your computer and use it in GitHub Desktop.
Save Howard-Chang/f0fabe67b4114e98d0429bbf5935ca3c to your computer and use it in GitHub Desktop.
HELP ME
#include<stdio.h>
int removeDuplicates(int* nums, int numsSize) {
}
int main()
{
int i=0,j=0,k=0,count=0;
int arr[]={1,2,2,3,3,4,5,5};
int index=8;
for(i=0;i<index;i++)
{
//printf("%d",index);
for(j=i+1;j<index;j++)
{
if(arr[i]==arr[j])
{
count++;
}
//printf("%d",count);
//printf("index:%d",index);
}
printf("進去前->index:%d count:%d",index,count);
if(count>0)
{
for(k=0;k<index;k++)
{
arr[i+k]=arr[i+count+k];
}
}
printf("出來後->index:%d count:%d",index,count);
index=index-count;
count=0;
}
/* for(i=0;i<index;i++)
printf("%d",arr[i]);*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment