


'''simple docstring'''







import functools






def 			lowercase				(_A   ,						_A					):







       """simple docstring"""







       _lowerCAmelCase    :							int   			=       len(_A					)
       _lowerCAmelCase    :							Optional[Any]   			=       len(_A					)

       @functools.cache
       def min_distance(_A   ,						_A					) -> int:
              # if first word index is overflow - delete all from the second word
              if indexa >= len_worda:
                     return len_worda - indexa
              # if second word index is overflow - delete all from the first word
              if indexa >= len_worda:
                     return len_worda - indexa
              _lowerCAmelCase    :							str   			=       int(worda[indexa] != worda[indexa]					)  # current letters not identical
              return min(
                  1 + min_distance(indexa + 1   ,						_A					)   ,						1 + min_distance(_A   ,						indexa + 1					)   ,						diff + min_distance(indexa + 1   ,						indexa + 1					)   ,						)

       return min_distance(0   ,						0					)


if __name__ == "__main__":
       import doctest

       doctest.testmod()





'''simple docstring'''







import unittest

from knapsack import greedy_knapsack as kp
class 	UpperCamelCase__					( unittest.TestCase	):



     """simple docstring"""






     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Union[str, Any]   			=       [10, 20, 30, 40, 50, 60]
            _lowerCAmelCase    :							Union[str, Any]   			=       [2, 4, 6, 8, 10, 12]
            _lowerCAmelCase    :							Dict   			=       100
            self.assertEqual(kp.calc_profit(snake_case__      ,	snake_case__      ,	snake_case__   )      ,	210   )







     def a	( self   ):

            '''simple docstring'''

            self.assertRaisesRegex(snake_case__      ,	'max_weight must greater than zero.'   )







     def a	( self   ):

            '''simple docstring'''

            self.assertRaisesRegex(snake_case__      ,	'Weight can not be negative.'   )







     def a	( self   ):

            '''simple docstring'''

            self.assertRaisesRegex(snake_case__      ,	'Profit can not be negative.'   )







     def a	( self   ):

            '''simple docstring'''

            self.assertRaisesRegex(snake_case__      ,	'max_weight must greater than zero.'   )







     def a	( self   ):

            '''simple docstring'''

            self.assertRaisesRegex(
                snake_case__      ,	'The length of profit and weight must be same.'   )


if __name__ == "__main__":
       unittest.main()

