Sher-Locked's blog

By Sher-Locked, history, 6 years ago, In English

include<stdio.h>

int maxDup(int arr[], int size) { int counter = 0, pocket = 1;

int i,j;
for(i=0;i<size;i++)
{
    counter = 0;
    for(j=0;j<size;j++)
    {

        if(arr[i] == arr[j])
            counter++;

    }

    if(counter > pocket)
    {
        pocket = pocket + (counter - pocket);
    }


}


return pocket;

}

int main(void) { int n; int i; int arr[101]; scanf("%d",&n); for(i= 0;i <n;i++) { scanf("%d",&arr[i]); }

printf("%d\n",maxDup(arr, n));

return 0;

}

  • Vote: I like it
  • -18
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Perhaps, you should use this site instead.