Jira Ticket: LND-124
LeetCode: https://leetcode.com/problems/valid-parentheses
Pattern: Tree Dfs
Difficulty: Easy
Status: To Do
Priority: Medium
Labels: Easy, Stack
Created: 2025-08-21
Last Updated: 2025-08-22
Problem URL: https://leetcode.com/problems/valid-parentheses Problem Description: Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:
- Open brackets must be closed by the same type of brackets.
- Open brackets must be closed in the correct order.
- Every close bracket has a corresponding open bracket of the same type. Example 1: Input: s = "()" Output: true Example 2: Input: s = "()[]{}" Output: true Example 3: Input: s = "(]" Output: false Constraints: 1 <= s.length <= 10^4 s consists of parentheses only '()[]{}'. Difficulty: Easy Category: Stack
- What are we asked to find/compute?
- What are the inputs and outputs?
- What are the edge cases?
Time Complexity: O(?)
Space Complexity: O(?)
Algorithm Steps: 1. 2. 3.
Time Complexity: O(?)
Space Complexity: O(?)
Example:
Step 1:
Step 2:
Step 3:
# Your solution here
def solution():
passInput:
Expected Output:
Actual Output:
Status: ⏳ Not Tested
Input:
Expected Output:
Actual Output:
Status: ⏳ Not Tested
Input:
Expected Output:
Actual Output:
Status: ⏳ Not Tested
- When to use tree dfs:
- When NOT to use this pattern:
- Pattern Guide
- LeetCode Discussion: https://leetcode.com/problems/valid-parentheses/discuss/
- Problem understood
- Pattern identified
- Brute force solution
- Optimized solution
- All test cases pass
- Complexity analyzed
- Code reviewed
- Learnings documented
- Jira ticket updated
Status: 🔴 Not Started
Last Updated: 2025-08-22