


"""simple docstring"""






class 							A_      :


  def __init__(			self:						List[Any]    ):







     '''simple docstring'''







     _lowerCamelCase   :				Any							=     ""
     _lowerCamelCase   :				Union[str, Any]							=     ""
     _lowerCamelCase   :				Optional[int]							=     []


  def 							_lowercase					(			self:						Optional[Any]							,__lowerCAmelCase:						int							,__lowerCAmelCase:						int    ):







     '''simple docstring'''







     if m == -1:
        return n + 1
     elif n == -1:
        return m + 1
     elif self.dp[m][n] > -1:
        return self.dp[m][n]
     else:
        if self.worda[m] == self.worda[n]:
           _lowerCamelCase   :				Tuple							=     self.__min_dist_top_down_dp(m - 1							,n - 1    )
        else:
           _lowerCamelCase   :				List[str]							=     self.__min_dist_top_down_dp(__lowerCAmelCase							,n - 1    )
           _lowerCamelCase   :				int							=     self.__min_dist_top_down_dp(m - 1							,__lowerCAmelCase    )
           _lowerCamelCase   :				int							=     self.__min_dist_top_down_dp(m - 1							,n - 1    )
           _lowerCamelCase   :				str							=     1 + min(__lowerCAmelCase							,__lowerCAmelCase							,__lowerCAmelCase    )

        return self.dp[m][n]


  def 							_lowercase					(			self:						int							,__lowerCAmelCase:						str							,__lowerCAmelCase:						str    ):







     '''simple docstring'''







     _lowerCamelCase   :				Dict							=     worda
     _lowerCamelCase   :				List[str]							=     worda
     _lowerCamelCase   :				Optional[Any]							=     [[-1 for _ in range(len(__lowerCAmelCase    )    )] for _ in range(len(__lowerCAmelCase    )    )]

     return self.__min_dist_top_down_dp(len(__lowerCAmelCase    ) - 1							,len(__lowerCAmelCase    ) - 1    )






  def 							_lowercase					(			self:						Dict							,__lowerCAmelCase:						str							,__lowerCAmelCase:						str    ):







     '''simple docstring'''







     _lowerCamelCase   :				List[str]							=     worda
     _lowerCamelCase   :				List[str]							=     worda
     _lowerCamelCase   :				Optional[int]							=     len(__lowerCAmelCase    )
     _lowerCamelCase   :				int							=     len(__lowerCAmelCase    )
     _lowerCamelCase   :				List[Any]							=     [[0 for _ in range(n + 1    )] for _ in range(m + 1    )]

     for i in range(m + 1    ):
        for j in range(n + 1    ):
           if i == 0:  # first string is empty
              _lowerCamelCase   :				Optional[Any]							=     j
           elif j == 0:  # second string is empty
              _lowerCamelCase   :				int							=     i
           elif worda[i - 1] == worda[j - 1]:  # last characters are equal
              _lowerCamelCase   :				Union[str, Any]							=     self.dp[i - 1][j - 1]
           else:
              _lowerCamelCase   :				Union[str, Any]							=     self.dp[i][j - 1]
              _lowerCamelCase   :				Optional[Any]							=     self.dp[i - 1][j]
              _lowerCamelCase   :				Dict							=     self.dp[i - 1][j - 1]
              _lowerCamelCase   :				int							=     1 + min(__lowerCAmelCase							,__lowerCAmelCase							,__lowerCAmelCase    )
     return self.dp[m][n]


if __name__ == "__main__":
  _lowerCAmelCase							:    Any					   =	EditDistance()

  print('''****************** Testing Edit Distance DP Algorithm ******************''')
  print()

  _lowerCAmelCase							:    Union[str, Any]					   =	input('''Enter the first string: ''').strip()
  _lowerCAmelCase							:    Tuple					   =	input('''Enter the second string: ''').strip()

  print()
  print(f'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
  print(f'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
  print()
  print('''*************** End of Testing Edit Distance DP Algorithm ***************''')




"""simple docstring"""






def 			snake_case		(		lowerCAmelCase_  ,						lowerCAmelCase_	)						->				int:
  return 1 if input_a == input_a else 0




def 			snake_case		(		)						->				None:
  assert xnor_gate(0  ,						0	) == 1
  assert xnor_gate(0  ,						1	) == 0
  assert xnor_gate(1  ,						0	) == 0
  assert xnor_gate(1  ,						1	) == 1


if __name__ == "__main__":
     print(xnor_gate(0, 0))
     print(xnor_gate(0, 1))
     print(xnor_gate(1, 0))
     print(xnor_gate(1, 1))





