Problem in last test case

one test case is not passing
code link : https://ide.codingblocks.com/s/88622

Hi @himanshukumarclassic37.hk,see i have made the required changes in your code.
instead of making character array just use string and then there is no need of idx you can simply use close for the base case that is if (close==n)then print your string and return.
you can a look at the code: