-
Notifications
You must be signed in to change notification settings - Fork 243
Target Sum
Linda Zhou edited this page Mar 31, 2023
·
3 revisions
- 🔗 Leetcode Link: https://leetcode.com/problems/target-sum/
- 💡 Difficulty: Medium
- ⏰ Time to complete: ___ mins
- 🛠️ Topics: Backtracking
- 🗒️ Similar Questions: Expression Add Operators
Understand what the interviewer is asking for by using test cases and questions about the problem.
- Established a set (2-3) of test cases to verify their own solution later.
- Established a set (1-2) of edge cases to verify their solution handles complexities.
- Have fully understood the problem and have no clarifying questions.
- Have you verified any Time/Space Constraints for this problem?
Run through a set of example cases:
Match what this problem looks like to known categories of problems, e.g. Linked List or Dynamic Programming, and strategies or patterns in those categories.
Plan the solution with appropriate visualizations and pseudocode.
General Idea:
1)
- What are some common pitfalls students might have when implementing this solution?
Implement the code to solve the algorithm.
Review the code by running specific example(s) and recording values (watchlist) of your code's variables along the way.
- Trace through your code with an input to check for the expected output
- Catch possible edge cases and off-by-one errors
Evaluate the performance of your algorithm and state any strong/weak or future potential work.
The complexity analysis based on how many elements there are in generateParenthesis(n).
- Time Complexity:
- Space Complexity: