Skip to content

Missing Test Case - 1773. Count Items Matching a Rule #10536

@Srijan-D

Description

@Srijan-D

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
<!-- 
![image](
https://user-images.githubusercontent.com/87586713/209465969-b53931aa-96ea-425b-8ca9-1e47cc4e85f3.png
)
-->



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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions