-
Notifications
You must be signed in to change notification settings - Fork 385
Closed
Description
Your LeetCode username
Category of the bug
- Question
- Solution
- Language
- Missing Test Cases
Description of the bug
Code you used for Submit/Run operation
// 1773. Count Items Matching a Rule
```class Solution {
public static int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {
int count = 0;
switch (ruleKey) {
case "type":
for (int i = 0; i < items.size(); i++) {
if (items.get(i).get(0) == ruleValue) {
count++;
}
}
break;
case "color":
for (int i = 0; i < items.size(); i++) {
if (items.get(i).get(1) == ruleValue) {
count++;
}
}
break;
case "name":
for (int i = 0; i < items.size(); i++) {
if (items.get(i).get(2) == ruleValue) {
count++;
}
}
break;
}
return count;
}
}```
#### Language used for code
<!-- JAVA -->
#### Expected behavior
<!-- A clear and concise description of what you expected to happen in
contrast with what actually happened. -->
#### Screenshots
<!--

-->
#### Additional context
<!-- code is working in the right way in my machine -->