Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.kietna.codeultimate;
- import java.util.Scanner;
- public class main {
- public static void main(String[] args){
- Scanner cin = new Scanner(System.in);
- int t = cin.nextInt();
- while(t > 0){
- int n = cin.nextInt();
- boolean flag = true;
- int arr[] = new int[100];
- for(int i = 0; i < n; i++){
- arr[i] = cin.nextInt();
- }
- for(int i = 0; i < n/2; i++){
- if(arr[i]!=arr[n-1-i]){
- flag = false;
- }
- }
- if(flag){
- System.out.println("YES");
- }else{
- System.out.println("NO");
- }
- t = t - 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement