human
Check if the Xor of the frequency of all digits of a number N is zero or not | Python implementation of the above approach.
creating a frequency array.
Finding the last digit of the number.
Dividing the number by 10 to eliminate last digit.
counting frequency of each digit.
checking if the xor of all frequency is zero or not.
Driver code"
Solution in Python:
 Can you provide a code to check if the Xor of the frequency of all digits of a number N is zero or not and the other steps required?
assistant
#Here is code to check if the Xor of the frequency of all digits of a number N is zero or not and the other steps required.
 def check ( s ) :
	freq = [ 0 ] * 10
	while ( s != 0 ) :
		r = s % 10
		s = s // 10
		freq [ r ] += 1
	xor = 0
	for i in range ( 10 ) :
		xor = xor ^ freq [ i ]
	if ( xor == 0 ) :
		return True
	else :
		return False
s = 122233
if ( check ( s ) ) :
	print ( " Yes " )
else :
	print ( " No " )