What would be the most efficient path to the result I’m looking for? I’m using ASP.NET 4.5 and C#.
Let say I have the following int list:
5,7,2,7,8,5,8,0,2,9,8,8,7
I want to remove duplicates from the list and order it by the number of appearances of each item. I know I can use LINQ’s Distinct() to make the items unique, but how can I also make it order by the number of appearances? This is the desired result for the example above:
8,7,5,2,0,9
1 Answer