



import unittest

from knapsack import greedy_knapsack as kp







class 	_snake_case							(			unittest.TestCase      ):






   '''simple docstring'''






   def 	A__  (  self:			int				)     ->	Union[str, Any]:
       UpperCAmelCase_			:    Union[str, Any]   						= [10, 20, 30, 40, 50, 60]
       UpperCAmelCase_			:    List[Any]   						= [2, 4, 6, 8, 10, 12]
       UpperCAmelCase_			:    str   						= 100
       self.assertEqual(kp.calc_profit(_UpperCamelCase   ,_UpperCamelCase   ,_UpperCamelCase				)   ,210				)


   def 	A__  (  self:			int				)     ->	Union[str, Any]:
       self.assertRaisesRegex(_UpperCamelCase   ,"""max_weight must greater than zero."""				)


   def 	A__  (  self:			List[Any]				)     ->	List[str]:
       self.assertRaisesRegex(_UpperCamelCase   ,"""Weight can not be negative."""				)


   def 	A__  (  self:			Union[str, Any]				)     ->	List[str]:
       self.assertRaisesRegex(_UpperCamelCase   ,"""Profit can not be negative."""				)


   def 	A__  (  self:			str				)     ->	str:
       self.assertRaisesRegex(_UpperCamelCase   ,"""max_weight must greater than zero."""				)






   def 	A__  (  self:			Dict				)     ->	List[str]:
       self.assertRaisesRegex(
           _UpperCamelCase   ,"""The length of profit and weight must be same."""				)


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


import functools






def    lowerCamelCase__				(				__lowerCAmelCase  :  str    ,							__lowerCAmelCase  :  str				):




			"""simple docstring"""


			lowerCAmelCase_						=	len(__lowerCAmelCase				)
			lowerCAmelCase_						=	len(__lowerCAmelCase				)

			@functools.cache
			def min_distance(__lowerCAmelCase  :  int    ,							__lowerCAmelCase  :  int				) -> 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_						=	int(worda[indexa] != worda[indexa]				)  # current letters not identical
						return min(
						    1 + min_distance(indexa + 1    ,							__lowerCAmelCase				)    ,							1 + min_distance(__lowerCAmelCase    ,							indexa + 1				)    ,							diff + min_distance(indexa + 1    ,							indexa + 1				)    ,							)

			return min_distance(0    ,							0				)


if __name__ == "__main__":
			import doctest

			doctest.testmod()



