Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. red
  2. red
  3. Grey
  4. Grey
  5. red
  6. blue
  7. blue
  8. Green
  9. White
  10. Grey
  11.  
  12. red Count=2 index=0 (contain the duplicate cluster start index)
  13. Grey Count=2 index=2
  14. red Count=1 index=4
  15. blue Count=2 index=5
  16. Green Count=1 index=6
  17. White Count=1 index=7
  18. Grey Count=1 index=8
  19.  
  20. var result = from p in a //a is the list
  21. group p by p into g
  22. select new { value=g.Key,count=g.Count()};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement