728x90
1 2 3 4 5 6 7 8 | public int solution(int[] A) { // write your code in Java SE 8 HashSet<Integer> hs = new HashSet<>(); for(int a : A) hs.add(a); return hs.size(); } | cs |
'알고리즘 풀이 > Codility' 카테고리의 다른 글
Codility - Brackets (Stacks and Queues) (0) | 2019.12.13 |
---|---|
Codility - Triangle (Sorting) (0) | 2019.12.13 |
codility - MaxProductOfThree (Sorting) (0) | 2019.12.13 |
codility - CountDiv (Prefix Sums) (0) | 2019.12.13 |
codility - MinAvgTwoSlice (Prefix Sums) (0) | 2019.12.13 |