




from __future__ import annotations

from collections.abc import Sequence
from typing import Literal







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							List[str]       =      list(__UpperCamelCase				)
     UpperCAmelCase_      :							Tuple       =      list(__UpperCamelCase				)
     UpperCAmelCase_      :							Tuple       =      0
     for i in range(len(__UpperCamelCase				)				):
          if lista[i] != lista[i]:
               count += 1
               UpperCAmelCase_      :							Union[str, Any]       =      '''_'''
     if count > 1:
          return False
     else:
          return "".join(__UpperCamelCase				)







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							str       =      []
     while True:
          UpperCAmelCase_      :							Dict       =      ['''$'''] * len(__UpperCamelCase				)
          UpperCAmelCase_      :							Any       =      []
          for i in range(len(__UpperCamelCase				)				):
               for j in range(i + 1			,						len(__UpperCamelCase				)				):
                    UpperCAmelCase_      :							Union[str, Any]       =      compare_string(binary[i]			,						binary[j]				)
                    if k is False:
                         UpperCAmelCase_      :							Optional[Any]       =      '''*'''
                         UpperCAmelCase_      :							Optional[int]       =      '''*'''
                         temp.append('''X'''				)
          for i in range(len(__UpperCamelCase				)				):
               if checka[i] == "$":
                    pi.append(binary[i]				)
          if len(__UpperCamelCase				) == 0:
               return pi
          UpperCAmelCase_      :							str       =      list(set(__UpperCamelCase				)				)







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Any       =      []
     for minterm in minterms:
          UpperCAmelCase_      :							List[str]       =      ''''''
          for _ in range(__UpperCamelCase				):
               UpperCAmelCase_      :							Optional[int]       =      str(minterm % 2				) + string
               minterm //= 2
          temp.append(__UpperCamelCase				)
     return temp







def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Dict       =      list(__UpperCamelCase				)
     UpperCAmelCase_      :							List[Any]       =      list(__UpperCamelCase				)
     UpperCAmelCase_      :							List[Any]       =      0
     for i in range(len(__UpperCamelCase				)				):
          if lista[i] != lista[i]:
               count_n += 1
     return count_n == count







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Any       =      []
     UpperCAmelCase_      :							Dict       =      [0] * len(__UpperCamelCase				)
     for i in range(len(chart[0]				)				):
          UpperCAmelCase_      :							str       =      0
          UpperCAmelCase_      :							List[str]       =      -1
          for j in range(len(__UpperCamelCase				)				):
               if chart[j][i] == 1:
                    count += 1
                    UpperCAmelCase_      :							Tuple       =      j
          if count == 1:
               UpperCAmelCase_      :							Any       =      1
     for i in range(len(__UpperCamelCase				)				):
          if select[i] == 1:
               for j in range(len(chart[0]				)				):
                    if chart[i][j] == 1:
                         for k in range(len(__UpperCamelCase				)				):
                              UpperCAmelCase_      :							List[Any]       =      0
               temp.append(prime_implicants[i]				)
     while True:
          UpperCAmelCase_      :							Any       =      0
          UpperCAmelCase_      :							int       =      -1
          UpperCAmelCase_      :							Dict       =      0
          for i in range(len(__UpperCamelCase				)				):
               UpperCAmelCase_      :							Dict       =      chart[i].count(1				)
               if count_n > max_n:
                    UpperCAmelCase_      :							Tuple       =      count_n
                    UpperCAmelCase_      :							int       =      i

          if max_n == 0:
               return temp

          temp.append(prime_implicants[rem]				)

          for i in range(len(chart[0]				)				):
               if chart[rem][i] == 1:
                    for j in range(len(__UpperCamelCase				)				):
                         UpperCAmelCase_      :							Dict       =      0







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Any       =      [[0 for x in range(len(__UpperCamelCase				)				)] for x in range(len(__UpperCamelCase				)				)]
     for i in range(len(__UpperCamelCase				)				):
          UpperCAmelCase_      :							str       =      prime_implicants[i].count('''_'''				)
          for j in range(len(__UpperCamelCase				)				):
               if is_for_table(prime_implicants[i]			,						binary[j]			,						__UpperCamelCase				):
                    UpperCAmelCase_      :							Optional[int]       =      1

     return chart







def lowerCamelCase__       (      ):

     '''simple docstring'''


     UpperCAmelCase_      :							Tuple       =      int(input('''Enter the no. of variables\n'''				)				)
     UpperCAmelCase_      :							Dict       =      [
         float(__UpperCamelCase				)
         for x in input(
             '''Enter the decimal representation of Minterms \'Spaces Separated\'\n'''				).split()
     ]
     UpperCAmelCase_      :							Optional[int]       =      decimal_to_binary(__UpperCamelCase			,						__UpperCamelCase				)

     UpperCAmelCase_      :							int       =      check(__UpperCamelCase				)
     print('''Prime Implicants are:'''				)
     print(__UpperCamelCase				)
     UpperCAmelCase_      :							Optional[Any]       =      prime_implicant_chart(__UpperCamelCase			,						__UpperCamelCase				)

     UpperCAmelCase_      :							int       =      selection(__UpperCamelCase			,						__UpperCamelCase				)
     print('''Essential Prime Implicants are:'''				)
     print(__UpperCamelCase				)


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     main()





from collections import defaultdict







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[int]       =      first_str.lower().strip()
     UpperCAmelCase_      :							Any       =      second_str.lower().strip()

     # Remove whitespace
     UpperCAmelCase_      :							Any       =      first_str.replace(''' '''			,						''''''				)
     UpperCAmelCase_      :							int       =      second_str.replace(''' '''			,						''''''				)

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

     # Default values for count should be 0
     UpperCAmelCase_      :							defaultdict[str, int]       =      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.""")