for ex n=2; (()) ()() generated but the required output is just opposite.
hello @Nidhi_Alipuria interchange line no 18 and 19. it will work.