human
Sort a Rotated Sorted Array | Function to find start index of array.
Function to restore the Original Sort.
array is already sorted.
In reverse ( ) , the first parameter is iterator to beginning element and second parameter is iterator to last element plus one ..
Function to print the Array.
Driver code"
How can the above be solved in Python?

=====
What is a code to sort a Rotated Sorted Array and the other steps required?
assistant
#Here is code to sort a Rotated Sorted Array and the other steps required.
 def findStartIndexOfArray ( arr , low , high ) :
	if ( low > high ) :
		return - 1 ;
	if ( low == high ) :
		return low ;
	mid = low + ( high - low ) / 2 ;
	if ( arr [ mid ] > arr [ mid + 1 ] ) :
		return mid + 1 ;
	if ( arr [ mid - 1 ] > arr [ mid ] ) :
		return mid ;
	if ( arr [ low ] > arr [ mid ] ) :
		return findStartIndexOfArray ( arr , low , mid - 1 ) ;
	else :
		return findStartIndexOfArray ( arr , mid + 1 , high ) ;
def restoreSortedArray ( arr , n ) :
	if ( arr [ 0 ] < arr [ n - 1 ] ) :
		return ;
	start = findStartIndexOfArray ( arr , 0 , n - 1 ) ;
	reverse ( arr , 0 , start ) ;
	reverse ( arr , start , n ) ;
	reverse ( arr ) ;
def printArray ( arr , size ) :
	for i in range ( size ) :
		print ( arr [ i ] , end = " " ) ;
def reverse ( arr , i , j ) :
	while ( i < j ) :
		temp = arr [ i ] ;
		arr [ i ] = arr [ j ] ;
		arr [ j ] = temp ;
		i += 1 ;
		j -= 1 ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 3 , 4 , 5 ] ;
	n = len ( arr ) ;
	restoreSortedArray ( arr , n ) ;
	printArray ( arr , n ) ;