Albatta, bu erda *Python* da yozilgan dastur kodi mavjud, u ko'chadagi barcha uylarni bo'yash uchun eng kam xarajatni qaytaradi, matritsa berilgan `costs`: ``` # 1-bosqich: s = [0] * n ketma-ketlik = [tuple(s) for _ in range(1, 3 ** n): s[0] += 1 for i in range(n): if s[i] == 3: s[i] = 0 s[i + 1] += 1 sequences.appendtuple(s)) # 2-bosqich: for i in range3 ** n - 1, -1, -1): for j in range (n - 1): if sequences[i][j] == sequences[i][j]: 1 sequences.pop (i) # 3-bosqich: costs_sequences = [in sequences] for
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence