21 Apr 2022 by OriginalGriff
A better approach would be simple: sort the array - C includes the C library function - qsort()[^] which will help you with that. Once sorted, all identical values are side by side - so counting identical values becomes trivial - a single pass...