Mana, siz so'ragan o'zgarishlarni amalga oshirish uchun yangilangan funksiyani qoldiraman: function generarMatrix(n) { const matrix = []; for (let i = 0; i < n; i++) { let num = i; if (i % 2 == 0) { num = 2; } else if (i % 2 == 1) { num = 1; } if (esPrimo(i)) { num = 3; } matrix.push(num); } matrix.push(-1); return matrix; } function isPrimo (((num) { if (< number 2) { return false; } for (let i = 2; i <= Math.sqrt(num); i++) { if % (num i = 0) { return false } } } true; Funksiyani generarMatrix matrixni 0 dan n gacha bo'lgan n-1 ga qaytaradi
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence