Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong algorithm used at C-Plus-Plus/stack/maximum_size_of_balanced_bracket_sequence.cpp #7530

Closed
Rishabh7896 opened this issue Jun 19, 2021 · 8 comments

Comments

@Rishabh7896
Copy link
Contributor

馃悰 Bug Report

(A clear and concise description of what the bug is.)

Have you read the Contributing Guidelines on Pull Requests?

This code doesnot handle the domain of question. It fails in many testcases.

@Rishabh7896 Rishabh7896 added the bug Something isn't working label Jun 19, 2021
@github-actions
Copy link

Hello @Rishabh7896,
Thank you for opening an issue. 馃コ
To get assigned to this particular issue please use /assign
Check this guide before contributing.

@Rishabh7896
Copy link
Contributor Author

/assign

@github-actions
Copy link

This issue has been assigned to @Rishabh7896!
It will become unassigned if it isn't closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.

@github-actions
Copy link

github-actions bot commented Jul 1, 2021

@Rishabh7896, this issue hasn't had any activity in 5 days. It will become unassigned in 7 days to make room for someone else to contribute.

@Amisha328
Copy link

Hey, @Rishabh7896
Could you please specify the test cases on which the algorithm fails?

@Rishabh7896
Copy link
Contributor Author

Input: )()()(((()
Expected Output: 4
Output: 6

If we will assume the answer to be the sum of the length of all valid sequences then it is correct, otherwise, it is wrong

@Amisha328
Copy link

Thank you for the test case.

But I think in this particular question, it is asked to print the maximum length of valid bracket sequence. So, we have to sum the number of brackets that make it valid.

So, the solution according to me is correct.

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Telegram or ping one of the reviewers. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants