1 ///2 /// Solution A 3 /// 100/100 4 /// 5 /// 6 ///7 public static int solution(int[] A) 8 { 9 if (A.Length == 0) return 0;10 int result = 1;11 Array.Sort(A);12 for (int i = 1; i < A.Length; i++)13 {14 if (A[i] != A[i - 1])15 result++;16 }17 return result;18 }19 20 /// 21 /// Solution B22 /// 100/10023 /// 24 /// 25 ///26 public static int solution(int[] A)27 {28 HashSet hs = new HashSet ();29 foreach (int num in A)30 {31 hs.Add(num);32 }33 return hs.Count;34 }