For this Question: Given an array <b>arr[]</b> of <b>N</b> distinct integers, check if this array is Sorted and Rotated clockwise. A sorted array is not considered sorted and rotated, i.e., there should be at least one rotation.
<b>Note:-</b>
The array can be sorted both increasingly  and decreasinglyThe first line of input contains the number of test cases T. Each test case contains 2 lines, the first line contains N, the number of elements in the array, and the second line contains N space-separated elements of the array.

<b>Constraints:</b>
1 <= T <= 50
3 <= N <= 10^3
1 <= A[i] <= 10^4



Print "<b>Yes</b>" if the given array is sorted and rotated, else Print "<b>No</b>", without Inverted commas.Sample Input:
2
4
3 4 1 2
3
1 3 2

Sample Output:
Yes
Yes

<b>Explanation:</b>
Testcase 1: The array is sorted (1, 2, 3, 4) and rotated twice (3, 4, 1, 2).
Testcase 2: The array is sorted (3, 2, 1) and rotated once (1, 3, 2)., I have written this Solution Code: #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N];

bool check_increasing(int n){
	int id = 0;
	for(int i = 2; i <= n; i++){
		if(a[i] < a[i-1]){
			id = i;
			break;
		}
	}
	if(id == 0)	return 0;
	int cur = id+1;
	while(cur != id+n){
		if(a[cur] <= a[cur-1])
			return 0;
		cur++;
	}
	return 1;
}
bool check_decreasing(int n){
	int id = 0;
	for(int i = 2; i <= n; i++){
		if(a[i] > a[i-1]){
			id = i;
			break;
		}
	}
	if(id == 0)	return 0;
	int cur = id+1;
	while(cur != id+n){
		if(a[cur] >= a[cur-1])
			return 0;
		cur++;
	}
	return 1;
}

signed main() {
	IOS;
	int t;	cin >> t;
	while(t--){
		int n;	cin >> n;
		for(int i = 1; i <= n; i++)
			cin >> a[i], a[i+n] = a[i];
		if(check_increasing(n))
			cout << "Yes" << endl;
		else if(check_decreasing(n))
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
 	}
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?