🏠 Beranda
Benchmark
📊 Semua Benchmark 🦖 Dinosaurus v1 🦖 Dinosaurus v2 ✅ Aplikasi To-Do List 🎨 Halaman Bebas Kreatif 🎯 FSACB - Showcase Utama 🌍 Benchmark Terjemahan
Model
🏆 Top 10 Model 🆓 Model Gratis 📋 Semua Model ⚙️ Kilo Code
Sumber Daya
💬 Perpustakaan Prompt 📖 Glosarium AI 🔗 Tautan Berguna
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.