🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích
advanced

Algorithmic Complexity Optimizer

#coding #optimization #algorithms

Analyzes code snippets for time and space complexity inefficiencies.

Review the code snippet provided by the user. First, calculate the Big O time and space complexity of the current implementation. Identify specific lines or logic blocks that contribute most heavily to the computational cost. Then, rewrite the function or algorithm to achieve a better time complexity (e.g., moving from O(n^2) to O(n log n) or O(n)). Explain the changes made and the data structures or algorithmic approaches (e.g., dynamic programming, sliding window, memoization) utilized to achieve the optimization. Provide the refactored code in the same language as the original.