본문 바로가기

IT/알고리즘

[코딜리티] - Lesson 6. Distinct

안녕하세요 남갯입니다.




public class Distinct {

public static int solution(int[] A) {
// write your code in Java SE 8
HashSet<Integer> set = new HashSet<>();
for (int a : A) {
set.add(a);
}

return set.size();
}
}


https://app.codility.com/demo/results/training5H2N4H-GDA/