Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public IEnumerable<string> GetThrash(Dictionary<string, int> source)
  2. {
  3. Dictionary<string, int> temp = new Dictionary<string, int>();
  4. foreach (var item in source)
  5. {
  6. if (item.Value > 60)
  7. {
  8. temp.Add(item.Key, item.Value);
  9. }
  10. }
  11.  
  12. temp.ToList().Sort(new Comparison<KeyValuePair<string, int>>(
  13. (KeyValuePair<string, int> a, KeyValuePair<string, int> b)
  14. =>
  15. {
  16. return a.Value - b.Value;
  17. }
  18. ));
  19.  
  20. foreach (var item in temp)
  21. {
  22. yield return item.Key;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement