-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Bug Report for minimum-remove-to-make-valid-parentheses #4076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@nzwt Thanks for the report. Sorry for the bug you faced. There will be some changes made to the driver code on the backend in short period and will resolve this issue. |
Just came here to report the same bug. I hope it gets rectified soon. I will add some more details, just in case. Bug Report for "Minimum Remove to Make Valid Parentheses"DescriptionI believe there's an issue with test case validation for the "Minimum Remove to Make Valid Parentheses" problem. The problem statement indicates that multiple valid solutions should be accepted, but the test case validator seems to be expecting a specific valid solution rather than accepting any valid solution. Both remove the minimum number of parentheses (5 unmatched opening parentheses at the end) ImplementationMy solution correctly identifies unmatched parentheses using a stack-based approach. For this specific test case, it removes the 5 unmatched opening parentheses at the end, but differs from the expected output in which specific parenthesis pair is kept near the "cccc" section. Requested ActionPlease verify that the test case validator is properly accepting any valid solution as mentioned in the problem statement, rather than requiring a specific valid solution. The code to reproduce the error:
|
Bug Report for https://neetcode.io/problems/minimum-remove-to-make-valid-parentheses
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
I got an error despite having a valid solution on leetcode
I got this error:
stderr
Traceback (most recent call last):
File "/box/script.py", line 141, in main
raise ValueError("Error: the string may contain only lowercase letters and parentheses.")
ValueError: Error: the string may contain only lowercase letters and parentheses.
Last executed test case
Input:
s="((((((dd(())a)())bbb)))()cccc((((("
Your Output:
"(((((dd(())a)())bbb)))()cccc"
Expected output:
"((((((dd(())a)())bbb))))cccc"
With this code:
def minRemoveToMakeValid(self, s: str) -> str:
#track positions of all parens, then find midpoint of each set
#this dosen't work becusuase you could have (bbep)(ppe)
#pair off each paren and you are left with any outliers
invalid = set()
res = ""
stack = []
The text was updated successfully, but these errors were encountered: