Get step-by-step solutions for algorithm problems with multiple approaches.
Solve this algorithm problem: Problem: [DESCRIBE THE PROBLEM] Input: [INPUT FORMAT AND CONSTRAINTS] Output: [EXPECTED OUTPUT FORMAT] Example: [PROVIDE EXAMPLE INPUT/OUTPUT] Please provide: 1. Problem analysis and clarifying questions 2. Brute force solution with explanation 3. Optimized solution(s) with different approaches 4. Time and space complexity analysis 5. Step-by-step walkthrough with the example 6. Edge cases to consider 7. Python implementation with type hints 8. Unit tests covering all cases 9. Common mistakes to avoid 10. Related problems to practice
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[DESCRIBE THE PROBLEM][INPUT FORMAT AND CONSTRAINTS][EXPECTED OUTPUT FORMAT]