No output in generate paranthesis prob

the code seems correct to me, unable to find the bug. there is not output on running.