human
Find the Mth element of the Array after K left rotations | Function to return Mth element of array after k left rotations.
The array comes to original state after N rotations.
Mth element after k left rotations is ( K + M - 1 ) % N th element of the original array.
Return the result.
Driver Code.
Array initialization.
Size of the array.
Given K rotation and Mth element to be found after K rotation.
Function call"
How can the above be solved in Python?

=====
What is a code to find the Mth element of the Array after K left rotations and the other steps required?
assistant
#Here is code to find the Mth element of the Array after K left rotations and the other steps required.
 def getFirstElement ( a , N , K , M ) :
	K %= N
	index = ( K + M - 1 ) % N
	result = a [ index ]
	return result
if __name__ == ' _ _ main _ _ ' :
	a = [ 3 , 4 , 5 , 23 ]
	N = len ( a )
	K = 2
	M = 1
	print ( getFirstElement ( a , N , K , M ) )