human
Program to check if all characters have even frequency | Python implementation of the above approach.
creating a frequency array.
Finding length of s.
counting frequency of all characters.
checking if any odd frequency is there or not.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to program to check if all characters have even frequency and the other steps required.
 def check ( s ) :
	freq = [ 0 ] * 26
	n = len ( s )
	for i in range ( n ) :
		freq [ ord ( s [ i ] ) - 97 ] += 1
	for i in range ( 26 ) :
		if ( freq [ i ] % 2 == 1 ) :
			return False
	return True
s = " abaccaba "
if ( check ( s ) ) :
	print ( " Yes " )
else :
	print ( " No " )