the link to the code is
https://www.codechef.com/problems/RAINBOWA

this is my code, please check and help me out

```
import java.io.*;
import java.lang.*;
import java.util.*;
class universe
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int T=Integer.parseInt(br.readLine());
for(int j=0;j<T;j++)
{
int N= Integer.parseInt(br.readLine());
int[]a= new int[N];
String st[] = br.readLine().split(" ");
for(int k=0;k<N;k++)
a[k]=Integer.parseInt(st[k]);
int tb=0;
for(int i=0;i<=(N/2);i++)
{
if(tb + 1==a[i])
tb++;
if(tb !=a[i] || a[i] !=a[N-i-1])
break;
}
if(tb==7)
System.out.println("yes");
else
System.out.println("no");
}
}
}
```

asked
**21 Aug '17, 11:56**

0★rishird94

20●4

accept rate:
0%