human
Check if given strings can be made same by swapping two characters of same or different strings | Function to check if all strings can be made equal by swapping any pair of characters from the same or different strings.
Stores length of string.
Store frequency of each distinct character of the strings.
Traverse the array.
Iterate over the characters.
Update frequency of arr [ i ] [ j ].
Traverse the array cntFreq [ ].
If cntFreq [ i ] is divisible by N or not.
Driver Code.
Function Call"
Solution in Python:

Write me a code to check if given strings can be made same by swapping two characters of same or different strings and the other steps required?
assistant
#Here is code to check if given strings can be made same by swapping two characters of same or different strings and the other steps required.
 def isEqualStrings ( arr , N ) :
	M = len ( arr [ 0 ] )
	cntFreq = [ 0 ] * 256
	for i in range ( N ) :
		for j in range ( M ) :
			cntFreq [ ord ( arr [ i ] [ j ] ) - ord ( ' a ' ) ] += 1
	for i in range ( 256 ) :
		if ( cntFreq [ i ] % N != 0 ) :
			return False
	return True
if __name__ == " _ _ main _ _ " :
	arr = [ " aab " , " bbc " , " cca " ]
	N = len ( arr )
	if isEqualStrings ( arr , N ) :
		print ( " YES " )
	else :
		print ( " NO " )