1
import java.util.*;
2
3
public class ImageDithering {
4
public int count(String dithered, String[] screen) {
5
int ans = 0;
6
for (int i = 0; i < screen.length; ++i) {
7
for (int j = 0; j < screen[0].length(); ++j) {
8
char ch = screen[i].charAt(j);
9
if (dithered.indexOf(ch) != -1) {
10
++ans;
11
}
12
}
13
}
14
return ans;
15
}
16
}

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16
