I AM NOT ABLE TO CHECK BOTH THE STRINGS AT THE SAME TIME, CAN YOU TELL ME HOW TO DO IT
Parenthesis(hackers block launchpad)
hey @Ayushi21, you should check it for one string only.
2
(((a+(b))+(c+d)))
((a+(b))+(c+d))
for the above input 2 is the testcase. You need to print whether (((a+(b))+(c+d))) has duplicate parenthesis or not in 1st line and same for ((a+(b))+(c+d)) in second line.
hey @Ayushi21, you need to check specially for ) and then pop all characters from the stack till ‘(‘ is occured. You also need to maintain a counter is used, which will be incremented ‘(‘ occurs.is found. If the value of the counter, is less than 1, then a pair of duplicate parenthesis.
refer to this code https://ide.codingblocks.com/s/110221
okh thank you so much.
hey @Ayushi21 , if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved