[Bronze II]
이번 문제는 배열에서 중복을 제거하는 방법을 알면 쉽게 풀 수 있는 문제이다.
Arrays 클래스의 distinct() 메소드를 사용하면 된다.
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] iarr = new int[10];
for(int i = 0; i < 10; i++) {
iarr[i] = Integer.valueOf(br.readLine()) % 42;
}
iarr = Arrays.stream(iarr).distinct().toArray();
System.out.println(iarr.length);
}
}