-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBingo.java
More file actions
28 lines (28 loc) · 764 Bytes
/
Bingo.java
File metadata and controls
28 lines (28 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.*;
public class ECCPR{
public static void main(String []args){
int k,n,nr;
Scanner sc=new Scanner(System.in);
k=sc.nextInt();
n=sc.nextInt();
ArrayList<Integer>list=new ArrayList<Integer>();
for(int i=0;i<k*k;i++){
nr=sc.nextInt();
list.add(nr);
}
for(int i=0;i<n;i++){
nr=sc.nextInt();
for(int j=0;j<list.size();){
if(list.get(j)==nr){
list.remove(j);
}else j++;
}
}
int suma=0;
if(list.size()==0){
System.out.print("BINGO!");
}else{
System.out.print(list.size());
}
}
}