🏠 Home
Benchmark
📊 Tutti i benchmark 🦖 Dinosauro v1 🦖 Dinosauro v2 ✅ App To-Do List 🎨 Pagine libere creative 🎯 FSACB - Ultimate Showcase 🌍 Benchmark traduzione
Modelli
🏆 Top 10 modelli 🆓 Modelli gratuiti 📋 Tutti i modelli ⚙️ Kilo Code
Risorse
💬 Libreria di prompt 📖 Glossario IA 🔗 Link utili
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.