#include using namespace std; int main(){ int n; cin >> n; vector types(n); for(int types_i = 0; types_i < n; types_i++){ cin >> types[types_i]; } // your code goes here /*Since there can be only 5 types, we create an array of size 5, where each index represents the type of the bird*/ vector countTypes(5); /*Increment the corresponding index of countTypes as per the type in the types array*/ for(int count_i = 0; count_i < n; count_i++){ countTypes[types[count_i]-1]++; } /*Now iterate the countTypes array and find the max value. Consider another value only if it is greater and not equal.*/ int max = countTypes[0]; int maxType = 1; for(int i = 1; i < 5; i++){ if (countTypes[i] > max){ max = countTypes[i]; maxType = i+1; } } cout << maxType; return 0; }