-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBovineGenomics.java
More file actions
42 lines (40 loc) · 1.16 KB
/
Copy pathBovineGenomics.java
File metadata and controls
42 lines (40 loc) · 1.16 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.util.Scanner;
public class BovineGenomics {
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
sc.nextLine();
char[][] spotted = new char[n][m];
char[][] plain = new char[n][m];
String input;
int counter = 0;
for(int i=0; i<n; i++){
input = sc.nextLine();
for(int j = 0; j<m; j++){
spotted[i][j] = input.charAt(j);
}
}
for(int i=0; i<n; i++){
input = sc.nextLine();
for(int j = 0; j<m; j++){
plain[i][j] = input.charAt(j);
}
}
for(int x = 0; x<m; x++){
boolean duplicate = false;
for(int y = 0; y<n; y++){
for(int z = 0; z<n; z++){
if(spotted[y][x] == plain[z][x]){
duplicate = true;
}
}
}
if(duplicate == false){
counter++;
}
}
System.out.println(counter);
sc.close();
}
}