You are viewing a single comment's thread. Return to all comments →
int count = 0; for(int i=0; i<n; i++){ if(c[i]!=0){ for(int j=i+1; j<n; j++){ if(c[i]==c[j]){ count++; c[j]=0; break; } } } } printf("%d", count);
Solution in C.. O(N^2).. Can it be optimized in C?? Please help..
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →
Solution in C.. O(N^2).. Can it be optimized in C?? Please help..