C 100% 100%
\n#include <string.h> // for strcmp()\n\n#define TYPE  0\n#define COLOR 1\n#define NAME  2\n\nint countMatches(char *** items, int itemsSize, int* itemsColSize,
```\n#include <string.h> // for strcmp()\n\n#define TYPE  0\n#define COLOR 1\n#define NAME  2\n\nint countMatches(char *** items, int itemsSize, int* itemsColSize, char * ruleKey, char * ruleValue){\n    int matches = 0;\n    int i, c = 0;\n    \n    switch(ruleKey[0]) {\n        case \'t\': c = TYPE; break;\n        case \'c\': c = COLOR; break;\n        case \'n\': c = NAME; break;\n        default: return -1;\n    }\n    \n    for(i=0; i<itemsSize; i++) {\n        // order is: [0] -> type, [1] -> color, [2] -> name\n        // `c\' contains index offset\n        if (strcmp(items[i][c], ruleValue) == 0) {\n            matches++;\n        }\n        \n    }\n    \n    return matches;\n    \n}\n```\n
['C']