Print string within bracket using recursion

why is the end bracket coming in output

my code
https://ide.codingblocks.com/s/36434

question
https://hack.codingblocks.com/contests/c/512/349

Your logic was correct but you made an error in doing substring.

https://ide.codingblocks.com/s/36554

I have made changes in your code and also commented your mistake. This passes all test cases successfully…