



'''simple docstring'''


class      __UpperCamelCase       :







	def __init__(    self						)    ->    Dict:
							'''simple docstring'''






							lowercase        =							""""""
							lowercase        =							""""""
							lowercase        =							[]







	def   _a   (    self ,				_lowerCAmelCase ,				_lowerCAmelCase						)    ->    Optional[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]:
																			lowercase        =							self.__min_dist_top_down_dp(m - 1 ,				n - 1						)
													else:
																			lowercase        =							self.__min_dist_top_down_dp(_lowerCAmelCase ,				n - 1						)
																			lowercase        =							self.__min_dist_top_down_dp(m - 1 ,				_lowerCAmelCase						)
																			lowercase        =							self.__min_dist_top_down_dp(m - 1 ,				n - 1						)
																			lowercase        =							1 + min(_lowerCAmelCase ,				_lowerCAmelCase ,				_lowerCAmelCase						)

													return self.dp[m][n]







	def   _a   (    self ,				_lowerCAmelCase ,				_lowerCAmelCase						)    ->    str:
							'''simple docstring'''






							lowercase        =							worda
							lowercase        =							worda
							lowercase        =							[[-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   _a   (    self ,				_lowerCAmelCase ,				_lowerCAmelCase						)    ->    Tuple:
							'''simple docstring'''






							lowercase        =							worda
							lowercase        =							worda
							lowercase        =							len(_lowerCAmelCase						)
							lowercase        =							len(_lowerCAmelCase						)
							lowercase        =							[[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
																									lowercase        =							j
																			elif j == 0:  # second string is empty
																									lowercase        =							i
																			elif worda[i - 1] == worda[j - 1]:  # last characters are equal
																									lowercase        =							self.dp[i - 1][j - 1]
																			else:
																									lowercase        =							self.dp[i][j - 1]
																									lowercase        =							self.dp[i - 1][j]
																									lowercase        =							self.dp[i - 1][j - 1]
																									lowercase        =							1 + min(_lowerCAmelCase ,				_lowerCAmelCase ,				_lowerCAmelCase						)
							return self.dp[m][n]


if __name__ == "__main__":
			lowercase_      :				Optional[int]   					=    EditDistance()

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

			lowercase_      :				Tuple   					=    input('''Enter the first string: ''').strip()
			lowercase_      :				Optional[int]   					=    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      SCREAMING_SNAKE_CASE				(				lowercase_    :      Union[str, Any] ,  lowercase_    :      str						):
						lowercase        =							""""""
						for i in table:
												res += inp[i - 1]
						return res







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      List[Any]						):
						return data[1:] + data[0]







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      Tuple ,  lowercase_    :      Dict						):
						lowercase        =							""""""
						for i in range(len(lowercase_						)						):
												if a[i] == b[i]:
																		res += "0"
												else:
																		res += "1"
						return res







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      str ,  lowercase_    :      str						):
						lowercase        =							int("""0b""" + data[0] + data[-1] ,  2						)
						lowercase        =							int("""0b""" + data[1:3] ,  2						)
						return bin(s[row][col]						)[2:]







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      Dict ,  lowercase_    :      Tuple ,  lowercase_    :      Tuple ,  lowercase_    :      str ,  lowercase_    :      Any						):
						lowercase        =							message[:4]
						lowercase        =							message[4:]
						lowercase        =							apply_table(lowercase_ ,  lowercase_						)
						lowercase        =							xor(lowercase_ ,  lowercase_						)
						lowercase        =							apply_sbox(lowercase_ ,  temp[:4]						)  # noqa: E741
						lowercase        =							apply_sbox(lowercase_ ,  temp[4:]						)
						lowercase        =							"""0""" * (2 - len(lowercase_						)) + l  # noqa: E741
						lowercase        =							"""0""" * (2 - len(lowercase_						)) + r
						lowercase        =							apply_table(l + r ,  lowercase_						)
						lowercase        =							xor(lowercase_ ,  lowercase_						)
						return temp + right


if __name__ == "__main__":
						lowercase_      :				Tuple   					=    input('''Enter 10 bit key: ''')
						lowercase_      :				Any   					=    input('''Enter 8 bit message: ''')

						lowercase_      :				Dict   					=    [6, 3, 7, 4, 8, 5, 10, 9]
						lowercase_      :				str   					=    [3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
						lowercase_      :				List[Any]   					=    [2, 4, 3, 1]
						lowercase_      :				List[str]   					=    [2, 6, 3, 1, 4, 8, 5, 7]
						lowercase_      :				Tuple   					=    [4, 1, 3, 5, 7, 2, 8, 6]
						lowercase_      :				Optional[Any]   					=    [4, 1, 2, 3, 2, 3, 4, 1]
						lowercase_      :				List[str]   					=    [[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
						lowercase_      :				List[Any]   					=    [[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

						# key generation
						lowercase_      :				Union[str, Any]   					=    apply_table(key, paa_table)
						lowercase_      :				Optional[Any]   					=    temp[:5]
						lowercase_      :				int   					=    temp[5:]
						lowercase_      :				List[str]   					=    left_shift(left)
						lowercase_      :				int   					=    left_shift(right)
						lowercase_      :				Tuple   					=    apply_table(left + right, pa_table)
						lowercase_      :				List[str]   					=    left_shift(left)
						lowercase_      :				Optional[Any]   					=    left_shift(right)
						lowercase_      :				Union[str, Any]   					=    left_shift(left)
						lowercase_      :				Union[str, Any]   					=    left_shift(right)
						lowercase_      :				Optional[int]   					=    apply_table(left + right, pa_table)

						# encryption
						lowercase_      :				int   					=    apply_table(message, IP)
						lowercase_      :				Dict   					=    function(expansion, sa, sa, keya, temp)
						lowercase_      :				Any   					=    temp[4:] + temp[:4]
						lowercase_      :				List[Any]   					=    function(expansion, sa, sa, keya, temp)
						lowercase_      :				Tuple   					=    apply_table(temp, IP_inv)
						print('''Cipher text is:''', CT)

						# decryption
						lowercase_      :				List[str]   					=    apply_table(CT, IP)
						lowercase_      :				Optional[int]   					=    function(expansion, sa, sa, keya, temp)
						lowercase_      :				Optional[Any]   					=    temp[4:] + temp[:4]
						lowercase_      :				Optional[int]   					=    function(expansion, sa, sa, keya, temp)
						lowercase_      :				Optional[Any]   					=    apply_table(temp, IP_inv)
						print('''Plain text after decypting is:''', PT)


