I am not able to understand this question can anyone tell me this question with some good explanation.
Not able to understand the question
@shivank.agg.sa Letβs get this question with an example :
6 3
)((
Here n = 4(Size of the final string) and m = 2 (Size of the given below string).
Now as we can see the string contains unbalanced Brackets. So to make this string balanced we have to add an Opening bracket at the start of the string After addition the string becomes β(β+")((" = β()((β Here we have done a + s where a = β(β and s = Original String. Now Still the String is unbalanced so we have to add Closing brackets at the end of the String Our String right now is a + s = β()((β after adding closing brackets we get β()((β + β))β = β()(())β Here we added b to the string therefore we got a+s+b. This was one possible way in which we can balance the string and you have to tell the No. of ways this can be done. I hope you got the Question.
sir what is the meaning of this line βAt any index, number of opening brackets should be greater than closing bracketsβ
@shivank.agg.sa That At any given instant Your Opening brackets should be greater than closing to maintain the String at any given instant balanced.