human
Character whose frequency is equal to the sum of frequencies of other characters of the given string | Function that returns true if some character exists in the given string whose frequency is equal to the sum frequencies of other characters of the string.
If string is of odd length.
To store the frequency of each character of the string.
Update the frequencies of the characters.
No such character exists.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to character whose frequency is equal to the sum of frequencies of other characters of the given string and the other steps required.
 def isFrequencyEqual ( string , length ) :
	if length % 2 == 1 :
		return False
	freq = [ 0 ] * 26
	for i in range ( 0 , length ) :
		freq [ ord ( string [ i ] ) - ord ( ' a ' ) ] += 1
	for i in range ( 0 , 26 ) :
		if freq [ i ] == length // 2 :
			return True
	return False
if __name__ == " _ _ main _ _ " :
	string = " geeksforgeeks "
	length = len ( string )
	if isFrequencyEqual ( string , length ) :
		print ( " Yes " )
	else :
		print ( " No " )