I have an unsorted array, what is the best method to remove all the duplicates of an element if present?
e.g:
a[1,5,2,6,8,9,1,1,10,3,2,4,1,3,11,3] >
Time O(n) space O(n) #include #include using namespace std; void fun(int arr[],int size){ int count=0; int has[100]={0}; for(int i=0;i