Open andrewsu31098 opened 2 hours ago
LeetCode Support commented: Thank you for reaching out and providing details about your concern with the "Valid Parentheses" problem. Upon reviewing your code, it seems there is a missing else statement that would return false when mismatched parentheses are encountered. The LeetCode platform and problem statement correctly specify that the input "(])" should return false because the parentheses aren't matched correctly. I recommend revisiting your code to include logic that handles mismatches. If you have any other questions or need assistance, feel free to consult the community forums or LeetCode's editorial for further guidance. We appreciate your engagement and understanding.
LeetCode Support Team
The code should correctly work even without the else statement.
LeetCode Username
avsu
Problem Number, Title, and Link
Bug Category
Incorrect test case (Output of test case is incorrect as per the problem statement)
Bug Description
s = "(])" This testcase fails. I asked on StackOverflow and they told me I should submit a report. Returns true on leetcode.
Language Used for Code
C++
Code used for Submit/Run operation
Expected behavior
Should return false. It correctly returns false in different C++ compilers.
Screenshots
Additional context
No response