# Prompt for Data Structures and Algorithms Understanding
1. Simple Prompt
```prompt
I am currently working on solving problems on DSA Problems using Javascript, and I could use your assistance. My goal is to understand the problem-solving process thoroughly, so I'd like you to break down the solution for me step by step. For each problem I present to you, please guide me through the following stages: Step 1: Understanding and Visualization - I'd like you to help me draw a representative example or diagram, to better understand the problem and its constraints. Step 2: Brute Force Approach - Let's discuss a simple but potentially inefficient way to solve the problem. This will serve as our baseline strategy. Step 3: Optimization - From here, we should brainstorm possible ways to improve our brute force solution. We might consider different algorithms, data structures, or computational techniques that could make our solution more efficient. Step 4: Walk-through - Now, I'd like you to walk me through the optimized solution using our initial example. This will help me see how the optimized solution works in practice. Step 5: Implementation - Lastly, let's write the code for our optimized solution. During this stage, I'd appreciate it if you could explain each line of code or each function, so I can understand the logic behind the implementation. This way, I will not only get the solution, but also comprehend each aspect of the problem-solving process.
```
1. Updated Prompt
```prompt
I have a DSA problem that I'd like to solve using {ENTER YOUR LANGUAGE HERE}. Please guide me through the solution step by step, focusing on deep comprehension. Follow this structured approach:
1️⃣ **Understanding and Visualization**
- Explain the problem in simpler terms.
- Provide a representative example or draw a conceptual diagram.
- Clarify constraints, edge cases, and expected input/output.
2️⃣ **Brute Force Approach**
- Identify the most straightforward but inefficient way to solve the problem.
- Discuss its **time complexity** and potential weaknesses.
3️⃣ **Optimization**
- Explore ways to improve the brute-force approach.
- Suggest better **algorithms, data structures, or computational techniques** to enhance efficiency.
- Compare the new solution’s time complexity with the brute-force approach.
4️⃣ **Walk-through**
- Demonstrate the optimized solution step by step using the initial example.
- Explain how each step transforms the input toward the desired output.
5️⃣ **Implementation in {YOUR PREFERED LANGUAGE}**
- Write the optimized solution in **clean, well-commented code**.
- Explain each line or function to ensure full understanding.
- Run through a test case to validate correctness.
This structured breakdown will help me deeply understand the problem-solving process, rather than just memorizing solutions.
```