Insertion sort algo is failing two test cases

#include<bits/stdc++.h>
using namespace std;
int main(){
long long int n;
cin>>n;
long long int a[n];
for(int i=0;i<=n-1;i++){
cin>>a[i];
}
for(int i=1;i<n;i++){
int e=a[i];
int j=i-1;
while(j>=0 and a[j]>e){
a[j+1]=a[j];
j–;
}
a[j+1]=e;
}
for(int i=0;i<n;i++){
cout<<a[i]<<" ";
}
}

@kishoretaru there is some issue with test cases it will be updated shortly.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.