- Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy path_1773.java
21 lines (19 loc) · 714 Bytes
/
_1773.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
packagecom.fishercoder.solutions.secondthousand;
importjava.util.List;
publicclass_1773 {
publicstaticclassSolution1 {
publicintcountMatches(List<List<String>> items, StringruleKey, StringruleValue) {
intmatch = 0;
for (List<String> item : items) {
if (ruleKey.equals("type") && item.get(0).equals(ruleValue)) {
match++;
} elseif (ruleKey.equals("color") && item.get(1).equals(ruleValue)) {
match++;
} elseif (ruleKey.equals("name") && item.get(2).equals(ruleValue)) {
match++;
}
}
returnmatch;
}
}
}