Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- var nums = new []{ 7, 2, 5, 5, 7, 6, 7 };
- var ans = 0;
- nums.GroupBy(x => x).Select(x =>
- {
- ans += x.Key;
- return x.Key;
- });
- Console.WriteLine(ans);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement