Sizga items nomli massiv berilgan, bunda har bir items[i] = [typei, colori, namei] mos ravishda elementning turi, rangi va nomini ifodalaydi.
Shuningdek, ikkita satr ruleKey va ruleValue berilgan.
Agar quyidagilardan biri to'g'ri bo'lsa, i-chi element qoidaga mos keladi deb hisoblanadi:
ruleKey == "type" va ruleValue == typeiruleKey == "color" va ruleValue == coloriruleKey == "name" va ruleValue == nameiQoidaga mos keladigan elementlar sonini qaytaring.
func solve(items [][]string, ruleKey string, ruleValue string) int {
// ...
}
Input: items = [["phone","blue","pixel"],["computer","silver","lenovo"],["phone","gold","iphone"]], ruleKey = "color", ruleValue = "silver"
Output: 1
Tushuntirish: Faqat bitta element mos keladi: ["computer","silver","lenovo"].
Input: items = [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]], ruleKey = "type", ruleValue = "phone"
Output: 2
Input: items = [["tv", "black", "sony"], ["tv", "white", "lg"]], ruleKey = "name", ruleValue = "lg"
Output: 1