using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] types_temp = Console.ReadLine().Split(' '); int[] types = Array.ConvertAll(types_temp,Int32.Parse); // your code goes here int[] b = new int[]{0,0,0,0,0}; int maxCount = 0; int mode = 0; for(int i = 0; i < n; i++){ switch (types[i]){ case 1: b[0]++; break; case 2: b[1]++; break; case 3: b[2]++; break; case 4: b[3]++; break; case 5: b[4]++; break; } //Console.WriteLine("the mode is " + mode + " and the count is: " + maxCount); } //Console.WriteLine(string.Join(" ", b)); for(int i=0; i < 5; i++){ if(maxCount < b[i]){ maxCount = b[i]; mode = i+1; } } Console.WriteLine(mode); } }