[Codility] [6–1] Distinct (score 75%)
Dec 14, 2021
【Lesson 6–1】: Distinct 去除重複的數字 (score 75%)
public static int Distinct(int[] A){List<int> dis = new List<int>();for (int i = 0; i < A.Length; i++){if (!dis.Contains(A[i]))dis.Add(A[i]);}return dis.Count;}