Can u please help me where i am worng in the code
/*
Author-> Codie_1(Akash)
*/
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(n) for(long long i=0;i<n;i++)
#define repp(n) for(long long i=0;i<=n;i++)
#define w(t) int t; cin>>t; while(tโ)
#define endl โ\nโ
#define pb push_back
#define mk make_pair
#define vi vector v
#define vl vector v;
typedef long long ll;
/The answer is just sumW - N * minW, where sumW is the sum of all W[i] and minW is the minimum over all W[i]./
int main()
{
// fast
w(t)
{
int n;
cin>>n;
int arr[n];
rep(n)
{
cin>>arr[i];
}
int i=0,j=n-1;
bool flag=true;
while(i<=j)
{
if(arr[i]!=arr[j])
{
flag=false;
break;
}
if(i==j)
{
if(arr[i]!=arr[i-1]+1 || arr[i]==arr[i-1])
flag=false;
}
i++;
jโ;
}
if(flag)
cout<<โyes\nโ;
else
cout<<โno\nโ;
}
return 0;
}