fork download
  1. public static IEnumerable<string> 出現頻度の高い順に並べる(IEnumerable<string> texts)
  2. {
  3. var sortedList = new SortedList<string, int>();
  4. foreach (var text in texts)
  5. {
  6. if (sortedList.ContainsKey(text))
  7. {
  8. sortedList[text]++;
  9. }
  10. else
  11. {
  12. sortedList.Add(text, 1);
  13. }
  14. }
  15. return texts.OrderByDescending(x => sortedList[x]);
  16. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty