why one of test cases is giving wrong answer?
please help.
code:
#include
using namespace std;
int main()
{
int n;
cin>>n;
long long int A[100000];
for(int i=0;i<n;i++)
{
cin>>A[i];
}
for(int i=0;i<n-1;i++)
{
int minindex=i;
for(int j=i+1;j<n;j++)
{
if(A[j]<A[i])
minindex=j;
}
swap(A[i],A[minindex]);
}
for(int i=0;i<n;i++)
{
cout<<A[i]<<endl;
}
return 0;
}