Function to check if a given array is sorted rotated or not
function isRotated ( arr , n ) { var l = 0 ; var r = n - 1 ; var pivot = - 1 ; if ( arr [ l ] > arr [ r ] ) { pivot = findPivot ( arr , l , r ) ; var temp = pivot ;