-
Notifications
You must be signed in to change notification settings - Fork 20.1k
Closed
Description
Is your feature request related to a problem? Please describe.
For a given expression in the form of a string, find if there exist any redundant brackets or not. It is given that the expression contains only rounded brackets or parenthesis and the input expression will always be balanced.
Describe the solution you'd like
Using the concept of Stack to approach the above problem.
Sample Testcase
Expression: (a+b)+c
Since there are no needless brackets, hence, the output must be 'false'.
Expression: ((a+b))
The expression can be reduced to (a+b). Hence the expression has redundant brackets and the output will be 'true'.
Additional context
I would like to contribute in DataStructures/Stacks folder
siriak
Metadata
Metadata
Assignees
Labels
No labels