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: 
cases = int(input())

for _ in range(cases):
    size = int(input())
    orig = list(map(int,input().split()))
    givenList = orig.copy()
    givenList.sort()
    flag = False

    for _ in range(size-1):
        ele = givenList.pop()
        givenList.insert(0,ele)
        if givenList == orig:
            print("Yes")
            flag = True
            break

    if not flag:
        givenList.sort()
        givenList.reverse()
        
        for _ in range(size-1):
            ele = givenList.pop()
            givenList.insert(0,ele)
            if givenList == orig:
                print("Yes")
                flag = True
                break
    
    if not flag:
        print("No"), In this Programming Language: Python, Now tell me if this Code is compilable or not?