In this Kata, you will be given an array and your task will be to determine if an array is in ascending or descending order and if it is rotated or not. 

Consider the array `[1,2,3,4,5,7,12]`. This array is sorted in `Ascending` order. If we rotate this array once to the left, we get `[12,1,2,3,4,5,7]` and twice-rotated we get `[7,12,1,2,3,4,5]`. These two rotated arrays are in `Rotated Ascending` order.

Similarly, the array `[9,6,5,3,1]` is in `Descending` order, but we can rotate it to get an array in `Rotated Descending` order: `[1,9,6,5,3]` or `[3,1,9,6,5]` etc.

Arrays will never be unsorted, except for those that are rotated as shown above. Arrays will always have an answer, as shown in the examples below.

More examples:
```Haskell
solve([1,2,3,4,5,7]) = "A" -- Ascending
solve([7,1,2,3,4,5]) = "RA" -- Rotated ascending
solve([4,5,6,1,2,3]) = "RA" -- Rotated ascending
solve([9,8,7,6]) = "D" -- Descending
solve([5,9,8,7,6]) = "RD" -- Rotated Descending
```
More examples in the test cases. 

Good luck!

Difficulty: introductory

Starter code:

def solve(arr):
	

Solutions:
def solve(lst):
    a, b, c = lst[0] < lst[1], lst[1] < lst[2], lst[-1] < lst[0]
    m = a if a == b else c
    return ('R' if c == m else '') + ('A' if m else 'D')

def solve(arr):
    if sorted(arr) == arr:
        return "A"
    if sorted(arr)[::-1] == arr:
        return "D"
    return "RA" if arr[0] > arr[-1] else "RD"

solve = lambda a:'R'*([min(a),max(a)]!=sorted(a[0::len(a)-1])) + ['D','A'][a[-1]-a[-2]>0]

def solve(arr):
    print(arr)
    if arr==sorted(arr):
        return 'A'
    if arr==sorted(arr,reverse=True):
        return 'D'    
    if arr!=sorted(arr) and arr[-2]>arr[-1]:
        return 'RD'
    if arr!=sorted(arr) and arr[-2]<arr[-1]:
        return 'RA'


 


def solve(arr):
    if arr == sorted(arr):
        return "A"
    elif arr == sorted(arr, reverse=True):
        return "D"
    elif arr[0]>arr[-1]:
        return "RA"
    else:
        return "RD"

def solve(arr):
    if arr[-1] > arr[-2]:
        if sorted(arr) == arr:
            return "A"
        else:
            return "RA"
    elif arr[-1] < arr[-2]:
        if sorted(arr)[::-1] == arr:
            return "D"
        else:
            return "RD"


from collections import Counter

def solve(a):
    c = Counter( (b>a)-(b<a) for a,b in zip(a, a[1:]) )
    return 'R'*(len(c)-1) + 'DA'[ (max(c, key=c.__getitem__)+1)//2 
                                  if len(c) == 1 or len(set(c.values())) != 1 
                                  else a[0] > a[-1] ]

def solve(a):
    c = sum((b>a)-(b<a) + 1j*(b-a) for a,b in zip(a, a[1:]))
    return 'R'*(len(a)-abs(c.real)!= 1) + 'DA'[c.real>0 if c.real else c.imag<0]

solve=lambda a:(lambda i:'R'*((a[-1]>a[0])-(a[-1]<a[0])==i)+'UDA'[i])(__import__('collections').Counter((x>y)-(x<y)for x,y in zip(a[-1:]+a,a)).most_common(1)[0][0])