



'''simple docstring'''





from heapq import heappop, heappush

import numpy as np
def    _SCREAMING_SNAKE_CASE  (       UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase							,    UpperCamelCase							,    ):



    """simple docstring"""





    lowerCAmelCase__      ,   lowerCAmelCase__ :  Tuple							      =					grid.shape
    lowerCAmelCase__ :  str							      =					[-1, 1, 0, 0]
    lowerCAmelCase__ :  int							      =					[0, 0, -1, 1]
    if allow_diagonal:
        dx += [-1, -1, 1, 1]
        dy += [-1, 1, -1, 1]

    lowerCAmelCase__      ,   lowerCAmelCase__ :  Tuple							      =					[(0, source)], set()
    lowerCAmelCase__ :  Any							      =					np.full((rows, cols)							,    np.inf			)
    lowerCAmelCase__ :  Dict							      =					0
    lowerCAmelCase__ :  List[Any]							      =					np.empty((rows, cols)							,    dtype=UpperCamelCase			)
    lowerCAmelCase__ :  Optional[int]							      =					None

    while queue:
        ((lowerCAmelCase__)      ,   (lowerCAmelCase__)) :  Union[str, Any]							      =					heappop(UpperCamelCase			)
        if (x, y) in visited:
            continue
        visited.add((x, y)			)

        if (x, y) == destination:
            lowerCAmelCase__ :  Optional[int]							      =					[]
            while (x, y) != source:
                path.append((x, y)			)
                lowerCAmelCase__      ,   lowerCAmelCase__ :  Optional[Any]							      =					predecessors[x, y]
            path.append(UpperCamelCase			)  # add the source manually
            path.reverse()
            return matrix[destination], path

        for i in range(len(UpperCamelCase			)			):
            lowerCAmelCase__      ,   lowerCAmelCase__ :  List[Any]							      =					x + dx[i], y + dy[i]
            if 0 <= nx < rows and 0 <= ny < cols:
                lowerCAmelCase__ :  Dict							      =					grid[nx][ny]
                if next_node == 1 and matrix[nx, ny] > dist + 1:
                    heappush(UpperCamelCase							,    (dist + 1, (nx, ny))			)
                    lowerCAmelCase__ :  List[Any]							      =					dist + 1
                    lowerCAmelCase__ :  Optional[int]							      =					(x, y)

    return np.inf, []


if __name__ == "__main__":
 import doctest

 doctest.testmod()



'''simple docstring'''




from collections import defaultdict




def 							lowerCamelCase	(      UpperCAmelCase__       :					str      ,      UpperCAmelCase__       :					str )			->      bool:
							lowercase_					:			Tuple										=       first_str.lower().strip()
							lowercase_					:			List[Any]										=       second_str.lower().strip()

							# Remove whitespace
							lowercase_					:			Dict										=       first_str.replace(""" """      ,      """""" )
							lowercase_					:			Tuple										=       second_str.replace(""" """      ,      """""" )

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

							# Default values for count should be 0
							lowercase_					:			defaultdict[str, int]										=       defaultdict(UpperCAmelCase__ )

							# For each character in input strings,
							# increment count in the corresponding
							for i in range(len(UpperCAmelCase__ ) ):
														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()
						_lowercase						: int						=						input("Enter the first string ").strip()
						_lowercase						: Tuple						=						input("Enter the second string ").strip()

						_lowercase						: Union[str, Any]						=						check_anagrams(input_a, input_b)
						print(f"""{input_a} and {input_b} are {"" if status else "not "}anagrams.""")





