🏠 Главная
Бенчмарки
📊 Все бенчмарки 🦖 Динозавр v1 🦖 Динозавр v2 ✅ Приложения To-Do List 🎨 Творческие свободные страницы 🎯 FSACB - Ультимативный показ 🌍 Бенчмарк перевода
Модели
🏆 Топ-10 моделей 🆓 Бесплатные модели 📋 Все модели ⚙️ Режимы Kilo Code
Ресурсы
💬 Библиотека промптов 📖 Глоссарий ИИ 🔗 Полезные ссылки
Advanced

Algorithm Optimization & Big-O

#python #algorithms #optimization #performance

Refactor an inefficient data processing script to optimize time and space complexity.

You are a Performance Engineer. I have a Python script that processes large log files (50GB+) to find unique IP addresses that accessed specific endpoints more than 100 times. The current implementation uses nested loops and runs in O(n^2) time, frequently causing memory overflow. Rewrite the solution using generators, hash maps, or efficient data structures to achieve O(n) time complexity and O(1) auxiliary space (excluding the storage for unique IPs). Include comments explaining the time and space complexity of each step and how you handle I/O bottlenecks.