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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum swaps for bracket balancing #6280

Open
1 of 4 tasks
Op-panda opened this issue Oct 21, 2021 · 1 comment
Open
1 of 4 tasks

Minimum swaps for bracket balancing #6280

Op-panda opened this issue Oct 21, 2021 · 1 comment

Comments

@Op-panda
Copy link
Contributor

Op-panda commented Oct 21, 2021

This is a(n):

  • New algorithm
  • Update to an existing algorithm
  • Error
  • Proposal to the Repository

Details:

Greedy Algorithm:
You are given a string of 2N characters consisting of N ‘[‘ brackets and N ‘]’ brackets. A string is considered balanced if it can be represented in the for S2[S1] where S1 and S2 are balanced strings. We can make an unbalanced string balanced by swapping adjacent characters. Calculate the minimum number of swaps necessary to make a string balanced.

@Op-panda
Copy link
Contributor Author

Op-panda commented Oct 21, 2021

@AdiChat please assign me this issue. I am a participant of Hacktoberfest.

@Op-panda Op-panda reopened this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant