human
Give me a code to check if two strings are permutation of each other and the other steps required given the following:
Check if two strings are permutation of each other | Python3 function to check whether two strings are Permutations of each other.
Create a count array and initialize all values as 0.
For each character in input strings , increment count in the corresponding count array.
If both strings are of different length . Removing this condition will make the program fail for strings like " aaca " and " aca ".
See if there is any non - zero value in count array"
How can the above be solved in Python?
assistant
#Here is code to check if two strings are permutation of each other and the other steps required.
 def arePermutation ( str1 , str2 ) :
	count = [ 0 for i in range ( NO_OF_CHARS ) ]
	i = 0
	while ( str1 [ i ] and str2 [ i ] ) :
		count [ str1 [ i ] ] += 1
		count [ str2 [ i ] ] -= 1
	if ( str1 [ i ] or str2 [ i ] ) :
	return False ;
	for i in range ( NO_OF_CHARS ) :
		if ( count [ i ] ) :
			return False ;
	return True ;