

from __future__ import annotations

from decimal import Decimal

from numpy import array





def a(lowercase__	):





	'''simple docstring'''
	snake_case_      		= Decimal

	# Check if the provided matrix has 2 rows and 2 columns
	# since this implementation only works for 2x2 matrices
	if len(_UpperCAmelCase	) == 2 and len(matrix[0]	) == 2 and len(matrix[1]	) == 2:
		# Calculate the determinant of the matrix
		snake_case_      		= float(
		    d(matrix[0][0]	) * d(matrix[1][1]	) - d(matrix[1][0]	) * d(matrix[0][1]	)	)
		if determinant == 0:
			raise ValueError('This matrix has no inverse.'	)

		# Creates a copy of the matrix with swapped positions of the elements
		snake_case_      		= [[0.0, 0.0], [0.0, 0.0]]
		snake_case_		,       snake_case_      		= matrix[1][1], matrix[0][0]
		snake_case_		,       snake_case_      		= -matrix[1][0], -matrix[0][1]

		# Calculate the inverse of the matrix
		return [
		    [(float(d(_UpperCAmelCase	)	) / determinant) or 0.0 for n in row] for row in swapped_matrix
		]
	elif (
	    len(_UpperCAmelCase	) == 3
	    and len(matrix[0]	) == 3
	    and len(matrix[1]	) == 3
	    and len(matrix[2]	) == 3
	):
		# Calculate the determinant of the matrix using Sarrus rule
		snake_case_      		= float(
		    (
		        (d(matrix[0][0]	) * d(matrix[1][1]	) * d(matrix[2][2]	))
		        + (d(matrix[0][1]	) * d(matrix[1][2]	) * d(matrix[2][0]	))
		        + (d(matrix[0][2]	) * d(matrix[1][0]	) * d(matrix[2][1]	))
		    )
		    - (
		        (d(matrix[0][2]	) * d(matrix[1][1]	) * d(matrix[2][0]	))
		        + (d(matrix[0][1]	) * d(matrix[1][0]	) * d(matrix[2][2]	))
		        + (d(matrix[0][0]	) * d(matrix[1][2]	) * d(matrix[2][1]	))
		    )	)
		if determinant == 0:
			raise ValueError('This matrix has no inverse.'	)

		# Creating cofactor matrix
		snake_case_      		= [
		    [d(0.0	), d(0.0	), d(0.0	)],
		    [d(0.0	), d(0.0	), d(0.0	)],
		    [d(0.0	), d(0.0	), d(0.0	)],
		]
		snake_case_      		= (d(matrix[1][1]	) * d(matrix[2][2]	)) - (
		    d(matrix[1][2]	) * d(matrix[2][1]	)
		)
		snake_case_      		= -(
		    (d(matrix[1][0]	) * d(matrix[2][2]	)) - (d(matrix[1][2]	) * d(matrix[2][0]	))
		)
		snake_case_      		= (d(matrix[1][0]	) * d(matrix[2][1]	)) - (
		    d(matrix[1][1]	) * d(matrix[2][0]	)
		)
		snake_case_      		= -(
		    (d(matrix[0][1]	) * d(matrix[2][2]	)) - (d(matrix[0][2]	) * d(matrix[2][1]	))
		)
		snake_case_      		= (d(matrix[0][0]	) * d(matrix[2][2]	)) - (
		    d(matrix[0][2]	) * d(matrix[2][0]	)
		)
		snake_case_      		= -(
		    (d(matrix[0][0]	) * d(matrix[2][1]	)) - (d(matrix[0][1]	) * d(matrix[2][0]	))
		)
		snake_case_      		= (d(matrix[0][1]	) * d(matrix[1][2]	)) - (
		    d(matrix[0][2]	) * d(matrix[1][1]	)
		)
		snake_case_      		= -(
		    (d(matrix[0][0]	) * d(matrix[1][2]	)) - (d(matrix[0][2]	) * d(matrix[1][0]	))
		)
		snake_case_      		= (d(matrix[0][0]	) * d(matrix[1][1]	)) - (
		    d(matrix[0][1]	) * d(matrix[1][0]	)
		)

		# Transpose the cofactor matrix (Adjoint matrix)
		snake_case_      		= array(_UpperCAmelCase	)
		for i in range(3	):
			for j in range(3	):
				snake_case_      		= cofactor_matrix[j][i]

        # Inverse of the matrix using the formula (1/determinant) * adjoint matrix
		snake_case_      		= array(_UpperCAmelCase	)
		for i in range(3	):
			for j in range(3	):
				inverse_matrix[i][j] /= d(_UpperCAmelCase	)

        # Calculate the inverse of the matrix
		return [[float(d(_UpperCAmelCase	)	) or 0.0 for n in row] for row in inverse_matrix]
	raise ValueError('Please provide a matrix of size 2x2 or 3x3.'	)



from collections import defaultdict





def a(lowercase__			, lowercase__	):





	'''simple docstring'''
	snake_case_      		= first_str.lower().strip()
	snake_case_      		= second_str.lower().strip()

	# Remove whitespace
	snake_case_      		= first_str.replace(' '			, ''	)
	snake_case_      		= second_str.replace(' '			, ''	)

	# Strings of different lengths are not anagrams
	if len(lowercase__	) != len(lowercase__	):
		return False

	# Default values for count should be 0
	snake_case_      		= defaultdict(lowercase__	)

	# For each character in input strings,
	# increment count in the corresponding
	for i in range(len(lowercase__	)	):
		count[first_str[i]] += 1
		count[second_str[i]] -= 1

	return all(_count == 0 for _count in count.values()	)


if __name__ == "__main__":
		from doctest import testmod

		testmod()
		A											=     input('Enter the first string ').strip()
		A											=     input('Enter the second string ').strip()

		A											=     check_anagrams(input_a, input_b)
		print(f"""{input_a} and {input_b} are {"" if status else "not "}anagrams.""")
