Bu yerda optimallashtirilgan kod: ``` funksiya countWeekendDaysOptimized($startDate, $endDate) { // Boshlash va yakunlash sanalarini Unix vaqt tamg'alariga aylantirish $start = strtotime($startDate); $end = strtotime($endDate); // Ikki sana o'rtasidagi kunlar sonini hisoblash $days = ceil(abs($end - $start) / 86400); // Ikki sana o'rtasidagi dam olish kunlari sonini hisoblash $weekendDays = ceil((($days + date'w', $start) - 1) / 7) * 2; // Agar boshlang'ich sana yakshanba bo'lsa, dam olish kunlari sonidan bittasini ayiring, agar (date'w', $start) == 0 { { $weekendDays-- }; // Agar dam olish
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence