(List<List<String>> items, String ruleKey, String ruleValue)
| 1 | class Solution { |
| 2 | public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) { |
| 3 | |
| 4 | int ans=0; |
| 5 | for(List l : items) |
| 6 | { |
| 7 | if((ruleKey.equals("type"))&&((l.get(0)).equals(ruleValue))) |
| 8 | { |
| 9 | ans++; |
| 10 | } |
| 11 | else if((ruleKey.equals("color"))&&((l.get(1)).equals(ruleValue))) |
| 12 | { |
| 13 | ans++; |
| 14 | } |
| 15 | else if((ruleKey.equals("name"))&&((l.get(2)).equals(ruleValue))) |
| 16 | { |
| 17 | ans++; |
| 18 | } |
| 19 | |
| 20 | } |
| 21 | |
| 22 | return ans; |
| 23 | |
| 24 | } |
| 25 | } |
nothing calls this directly
no outgoing calls
no test coverage detected