"Simplicity can't be bought later, it must be earned from the start" -- DB
public class Solution { public int SumOfUnique(int[] nums) { var hs = from n in nums group n by n into g where g.Count() == 1 select g.Key; return hs.Sum(); } }
No comments:
Post a Comment