using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { //try two variables tracking through loop vs array.max at end 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[] birdCount = new int[5]; for (int i = 0; i < n; i++){ int val = types[i] - 1; birdCount[val] ++; } int max = birdCount.Max(); Console.WriteLine(birdCount.ToList().IndexOf(max)+1); } }