human
First strictly greater element in a sorted array in Java | Python program to find first element that is strictly greater than given target ..
Move to right side if target is greater ..
Move left side ..
Driver code"
How can the above be solved in Python?
 Write me a code to first strictly greater element in a sorted array in Java and the other steps required?
assistant
#Here is code to first strictly greater element in a sorted array in Java and the other steps required.
 def next ( arr , target ) :
	start = 0 ;
	end = len ( arr ) - 1 ;
	ans = - 1 ;
	while ( start <= end ) :
		mid = ( start + end ) // 2 ;
		if ( arr [ mid ] <= target ) :
			start = mid + 1 ;
		else :
			ans = mid ;
			end = mid - 1 ;
	return ans ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 3 , 5 , 8 , 12 ] ;
	print ( next ( arr , 8 ) ) ;