90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

// with a little more work, it could be made O(n), assuming O(max element) fits in memory

// if it does not fit, you could still do it in O(n) expected time, O(n log n) worst case

#include <stdlib.h>

#define len(a) (sizeof(a)/sizeof(*a))

int n=0;

unsigned int m=0;

for(int i=0; i < len(a); i++){ if( a[i] > m ){ m = a[i]; } }

char *s=(char *)calloc(m,1);

for(int i =0; i < len(a); i++){

int j=0;

if( !s[a[i]] ){

a[n++]=a[i];

}

s[a[i]]=1;

}