I can’t understand the problem. What are strings a and b, and what is the use of ‘n’.
It would be great if you can explain with an example.
Brackets all over - problem not clear
n is the size of the string which will be after adding a + s + b.
a and b are the strings you have to add to original string of size m to make it to size n where n = a+s+b and count no of ways it can be done modulo 10^9 + 7 , if answer exists otherwise print -1.
For example :
if n = 4 , m = 2 and s = “((”.
as you have to make this string of length 4 and satisfy the conditions of the problem , a = “” and b = “))” . In this way a + s+ b becomes 4 and there is only 1 way of doing it so answer is 1
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.