Beginner Problem-please help! CMPRSS

#include <stdio.h>

int main(void) {
int N;//Number of test cases
scanf("%d", &N);
for(int i=0; i<N; i++)
{
int n;//Number of integers in a test case
scanf("%d", &n);
int A[n], B[1000];
for(int j=0; j<n; j++)
{
scanf("%d", &A[j]);
}
int x, y;
x=A[0];
y=A[n-1];
B[x-1]=A[0];
for(int k=x, j=1; k<y; j++)
{
if(A[j]==A[j-1]+1)
{B[k]=A[j];
k++;}
else
{
for(int i=1; i<A[j]-A[j-1]; i++)
{
B[k]=0;
k++;
}B[k]=A[j];
k++;
}
}
char str[]="…";
for(int j=x-1; j<y;)
{
while(B[j]==0)
j++;
int count =0;
while(B[j]!=0&&j<y)
{
j++;
count++;
}j=j-count;
if(count==1)
{
printf("%d", B[j]);
if(j<y-1)
printf(",");
j=j+1;
}
if(count==2)
{
printf("%d,%d", B[j], B[j+1]);
if(j<y-2)
printf(",");
j=j+2;
}
if(count>2)
{
printf("%d", B[j]);
printf("\b%s", str);
printf("%d", B[j+count-1]);
if(j<y-count)
printf(",");
j=j+count;
}
}printf("\n");
}
return 0;
}

first format your code or give your submission link and also give the question link too :slight_smile: