Skip to content

Commit adc020f

Browse files
committed
Runtime: 9 ms (Top 16.84%) | Memory: 57.3 MB (Top 8.89%)
1 parent 62f3e29 commit adc020f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
// Runtime: 9 ms (Top 16.84%) | Memory: 57.3 MB (Top 8.89%)
2+
13
class Solution {
24
public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {
35
int res = 0;
4-
6+
57
for(int i = 0 ;i<items.size();i++){
68
if(ruleKey.equals("type") && items.get(i).get(0).equals(ruleValue)) res++;
79
if(ruleKey.equals("color") && items.get(i).get(1).equals(ruleValue)) res++;
810
if(ruleKey.equals("name") && items.get(i).get(2).equals(ruleValue)) res++;
911
}
10-
12+
1113
return res;
12-
14+
1315
}
14-
}
16+
}

0 commit comments

Comments
 (0)