



'''simple docstring'''

class __snake_case:


						'''simple docstring'''



						def __init__( self				)     ->     List[str]:
							lowerCAmelCase   =     ''''''
							lowerCAmelCase   =     ''''''
							lowerCAmelCase   =     []


						def     __snake_case   ( self     ,	A_     ,	A_				)     ->     int:
							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   =     self.__min_dist_top_down_dp(m - 1     ,	n - 1				)
								else:
									lowerCAmelCase   =     self.__min_dist_top_down_dp(__lowercase     ,	n - 1				)
									lowerCAmelCase   =     self.__min_dist_top_down_dp(m - 1     ,	__lowercase				)
									lowerCAmelCase   =     self.__min_dist_top_down_dp(m - 1     ,	n - 1				)
									lowerCAmelCase   =     1 + min(__lowercase     ,	__lowercase     ,	__lowercase				)

								return self.dp[m][n]


						def     __snake_case   ( self     ,	A_     ,	A_				)     ->     Union[str, Any]:
							lowerCAmelCase   =     worda
							lowerCAmelCase   =     worda
							lowerCAmelCase   =     [[-1 for _ in range(len(__lowercase				)				)] for _ in range(len(__lowercase				)				)]

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




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


if __name__ == "__main__":
				UpperCAmelCase     		=   EditDistance()

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

				UpperCAmelCase     		=   input('Enter the first string: ').strip()
				UpperCAmelCase     		=   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'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase     		=   logging.get_logger(__name__)

class __snake_case(				_lowerCAmelCase ):


						'''simple docstring'''



						UpperCAmelCase							:   Optional[int]									=		"timm_backbone"


						def __init__( self     ,	A_=None     ,	A_=3     ,	A_=True     ,	A_=True     ,	A_=None     ,	**A_     ,	)     ->     int:
							super().__init__(**A_				)
							lowerCAmelCase   =     backbone
							lowerCAmelCase   =     num_channels
							lowerCAmelCase   =     features_only
							lowerCAmelCase   =     use_pretrained_backbone
							lowerCAmelCase   =     True
							lowerCAmelCase   =     out_indices if out_indices is not None else (-1,)