We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
staticintmigratoryBirds(intn,int[]ar){// Complete this functionvardic=newDictionary<int,int>();dic.Add(1,0);dic.Add(2,0);dic.Add(3,0);dic.Add(4,0);dic.Add(5,0);for(inti=0;i<n;i++){dic[ar[i]]++;}returndic.FirstOrDefault(Q=>Q.Value==dic.Values.Max()).Key;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
this is my algo in c# to solve the problem.