For this Question: In the morning assembly, there are N students standing in a line, such that the ith student from the front has height H[i]. 

In one move, you can pick any two students and swap their positions.

If you are allowed to do only one swap, can you arrange the students in increasing order of their hieghts?The first line of input contains T, the number of test cases.
The first line of each test case contains N, the number of students in the line.
The second line of each test case contains the heights of N students, where the ith index is the height of ith student.

<b>Constraints:</b>
1 <= T <= 10<sup>3</sup>
1 <= N <= 10<sup>4</sup>
1 <= H_i <= 10<sup>5</sup>For each test case, output YES or NOSample Input
2
3
1 2 3
4
2 1 4 3

Sample Output
YES
NO

Explanation:
The students are already standing in increasing order in the first test case, hence the answer is YES., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

signed main(){
    int t=1;
    cin>>t;
    while(t--){
        int n; cin>>n;
        vector<int> v(n);
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        vector<int> b= v;
        sort(b.begin(),b.end());
        int cnt=0;
        for(int i=0;i<n;i++){
            if(b[i]!=v[i]) cnt++;
        }
        if(cnt==0 or cnt==2){
            cout<<"YES\n";
        }else cout<<"NO\n";
    }
    return 0;
}

, In this Programming Language: C++, Now tell me if this Code is compilable or not?