#include #include #include #include #include #include #include int main(){ int n; scanf("%d",&n); int *types = malloc(sizeof(int) * n); for(int types_i = 0; types_i < n; types_i++){ scanf("%d",&types[types_i]); } // boundary check if (n < 5 || n > 2 * 100000) return 0; // increase counter int *counts = malloc(sizeof(int) * n); for (int i = 0; i < n; i++) { counts[types[i]]++; } // find the maximum count int max = 0; int index; for (int i = 0; i < n; i++) { if (counts[i] > max) { max = counts[i]; index = i; } } // print the index of the maximum count printf("%d", index); return 0; }