Marks :100
: 1 | : 11
Given a string of length N contains only parentheses, Scan it to see if it is well nested or not.
The String is said to be well nested if we can apply any maths equation within the given parentheses correctly or not.
If the string is well-nested return it as it otherwise makes some operation says addition and modification by choosing any index and opening or closing bracket or modifying the current bracket.
We are not concerned with the number of operations we performed.
The first line of the test case contains an integer N the length of the string ($$$1 \le N \le 10^5$$$).
The second line contains the string S of length N.
For each test case print a well-formed string
5 (()))
(())()
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.