title: codechef problem COVIDLQ wrong anwer error
body: <p>in <a href="https://www.codechef.com/problems/COVIDLQ" rel="nofollow noreferrer">https://www.codechef.com/problems/COVIDLQ</a> problem my test cases are giving me correct answer. But after submitting it says wrong answer(WA). Can anyone explain what is wrong in this code.</p>
  
  <pre><code>#include&lt;stdlib.h&gt;
  
  int main()
  {
      int test_case,j,N,x=0,diff=0,yes;
      int *a;
      int *b;
      scanf("%d",&amp;test_case);
      while(test_case--&gt;0)
      {
          scanf("%d",&amp;N);
          a=(int*)malloc(N*sizeof(int));
          b=(int*)malloc(N*sizeof(int));
          for(j=0;j&lt;N;j++)
          scanf("%d",&amp;a[j]);
  
              for(j=0;j&lt;N;j++)
              {
                  if(a[j]==1)
                  {
                      b[x++]=j;
                  }
              }
              for(j=0;j&lt;x-1;j++)
              {
                  diff=b[j+1]-b[j];
                  if(diff&gt;=6)
                  yes=1;else yes=0;
              }
  
  
              if(yes==1 || x==1)
                  printf("YES\n");
                  else
                  printf("NO\n");
  
      }
  }
  </code></pre>