Explain the time complexity of your code and how you would optimize it.
Sigiloso
I explained the current time complexity using Big O notation and suggested an optimized approach using a different data structure, improving performance from O(n²) to O(n log n). I also discussed trade-offs.