🏠 Accueil
Benchmarks
📊 Tous les Benchmarks 🦖 Dinosaure v1 🦖 Dinosaure v2 ✅ To-Do List Apps 🎨 Pages Libres 🎯 FSACB - Showcase 🌍 Traduction
Modèles
🏆 Top 10 Modèles 🆓 Modèles Gratuits 📋 Tous les Modèles ⚙️ Modes Kilo Code
Ressources
💬 Prompts IA 📖 Glossaire IA 🔗 Liens Utiles
advanced

Big O Optimization Challenge

#algorithms #optimization #coding

Optimize a specific recursive algorithm to improve time and space complexity.

Consider a recursive function that calculates the nth Fibonacci number but has exponential time complexity. Rewrite this function to achieve O(n) time complexity and O(1) space complexity using an iterative approach or matrix exponentiation. Explain the mathematical reasoning behind the optimization and the trade-offs involved.