HarshCasper / NeoAlgo

Bringing all Data Structures and Algorithms under one Roof ⚡
MIT License
875 stars 1.05k forks source link

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

Closed Rishabh7896 closed 2 years ago

Rishabh7896 commented 3 years ago

🐛 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.

github-actions[bot] commented 3 years ago

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

Rishabh7896 commented 3 years ago

/assign

github-actions[bot] commented 3 years ago

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[bot] commented 3 years ago

@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 commented 3 years ago

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

Rishabh7896 commented 3 years ago

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 commented 3 years ago

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[bot] commented 2 years ago

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!