human
Find repeated character present first in a string | Python3 program to find the first character that is repeated.
this is O ( N ^ 2 ) method.
Driver code"
Solution in Python:
assistant
#Here is code to find repeated character present first in a string and the other steps required.
 def findRepeatFirstN2 ( s ) :
	p = - 1
	for i in range ( len ( s ) ) :
		for j in range ( i + 1 , len ( s ) ) :
			if ( s [ i ] == s [ j ] ) :
				p = i
				break
		if ( p != - 1 ) :
			break
	return p
if __name__ == " _ _ main _ _ " :
	str = " geeksforgeeks "
	pos = findRepeatFirstN2 ( str )
	if ( pos == - 1 ) :
		print ( " Not ▁ found " )
	else :
		print ( str [ pos ] )