PLAYFIT practice

#include <bits/stdc++.h>
using namespace std;

int main() {
// your code goes here
int test;
cin>>test;
while(test–){
int n,x;
cin>>n;
int ans=-1;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int mini=a[0];
for(int i=1;i<n;i++){
ans=max(ans, a[i]-mini);
mini=min(mini, a[i]);
}
if(ans==-1){
cout<<“UNFIT”<<endl;
}else{
cout<<ans<<endl;
}
}
return 0;
}

I dont understand why my code fails in this question. I checked the editorial and it contains the same logic as this. Plz help me out.

format your code or share a link