|
|
back to boardWrong answer in Java 1.7 test 1 import java.util.Scanner; public class _1991 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b, i; a = sc.nextInt(); int[] str = new int[a]; for (i = 0; i < a; i++) { str[i] = sc.nextInt(); } b = sc.nextInt(); int counter = 0; for (i = 0; i < b; i++) { int c = sc.nextInt(); for (int aStr : str) { if (aStr == c) { counter++; } } } System.out.println(counter); } } |
|
|