generate ....()

… …

This should suffice I suppose:

.........................

Or if you are eventually going to print the result,

while(n--)
    .........................
int i,j,n;
scanf("%d",&n); j=0;

for(i=(n-1);i>=0;--i)
            {
            .......... 

        } 

thanks to rajat for help.

Hi, that’s actually a problem from an ongoing contest. Programming Problems and Competitions :: HackerRank Please do not ask questions related to this problem, while it is ongoing.

1 Like