How to improve complexity after a correct baseline
The solution is already correct. How do you locate the bottleneck, reduce time or space complexity, and prove that the optimized version preserves the result?
Answer as you would in an interview
Answer aloud or write down a few key points. The text field is optional; the review opens after your attempt.