Cant get the Logic?

please help with more test cases !
BRACKETS ALL OVER problem.

Hi GAGAN,
Some more testcases are:

//Input 0
6 2
)(
//Output 0
3
//Explanation
Possible strings of length 6 =

  • “((” + “)(” + “))”
  • “()(” + “)(” + “)”
  • “(” + “)(” + “)()”

//Input 1
8 4
)())
//Output 1
5
//Explanation
Possible strings of length 8 =

  • “((” + “)())” + “()”
  • “(((” + “)())” + ")
  • “(()(” + “)())” + “”
  • “()((” + “)())” + “”
  • “((()” + “)())” + “”

Hope this heps :slight_smile:

Hey Gagan, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.