int k = 0 ;
int n = 12
while(k<n)
curly braces open
k = k +1;
curly braces close
Pls give the output.
Answers
Answered by
1
Answer:
Input : str = "(())))("
Output: 4
After index 4, string splits into (())
and ))(. Number of opening brackets in the
first part is equal to number of closing
brackets in the second part.
Input : str = "))"
Output: 2
As after 2nd position i.e. )) and "empty"
string will be split into these two parts:
So, in this number of opening brackets i.e.
0 in the first part is equal to number of
closing brackets in the second part i.e.
also 0.
Answered by
1
Answer:
After index 4, string splits into (())
and ))(. Number of opening brackets in the
first part is equal to number of closing
brackets in the second part.
Similar questions