


'''simple docstring'''






def       _snake_case     (  A				,					A )		->					str:
       _enforce_args(A				,					A )
       if n == 0:
              return 0
       lowerCAmelCase__      =			float('''-inf''' )
       for i in range(1				,					n + 1 ):
              lowerCAmelCase__      =			max(
                  A				,					prices[i - 1] + naive_cut_rod_recursive(n - i				,					A ) )

       return max_revue


def       _snake_case     (  A				,					A )		->					str:
       _enforce_args(A				,					A )
       lowerCAmelCase__      =			[float('''-inf''' ) for _ in range(n + 1 )]
       return _top_down_cut_rod_recursive(A				,					A				,					A )


def       _snake_case     (  A				,					A				,					A )		->					str:
       if max_rev[n] >= 0:
              return max_rev[n]
       elif n == 0:
              return 0
       else:
              lowerCAmelCase__      =			float('''-inf''' )
              for i in range(1				,					n + 1 ):
                     lowerCAmelCase__      =			max(
                         A				,					prices[i - 1] + _top_down_cut_rod_recursive(n - i				,					A				,					A )				,					)

              lowerCAmelCase__      =			max_revenue

       return max_rev[n]


def       _snake_case     (  A				,					A )		->					Union[str, Any]:
       _enforce_args(A				,					A )

       # length(max_rev) = n + 1, to accommodate for the revenue obtainable from a rod of
       # length 0.
       lowerCAmelCase__      =			[float('''-inf''' ) for _ in range(n + 1 )]
       lowerCAmelCase__      =			0

       for i in range(1				,					n + 1 ):
              lowerCAmelCase__      =			max_rev[i]
              for j in range(1				,					i + 1 ):
                     lowerCAmelCase__      =			max(A				,					prices[j - 1] + max_rev[i - j] )

              lowerCAmelCase__      =			max_revenue_i

       return max_rev[n]


def       _snake_case     (  A				,					A )		->					Optional[int]:
       if n < 0:
              lowerCAmelCase__      =			F"""n must be greater than or equal to 0. Got n = {n}"""
              raise ValueError(A )

       if n > len(A ):
              lowerCAmelCase__      =			(
                  '''Each integral piece of rod must have a corresponding price. '''
                  F"""Got n = {n} but length of prices = {len(A )}"""
              )
              raise ValueError(A )


def       _snake_case     (  )		->					Union[str, Any]:
       lowerCAmelCase__      =			[6, 10, 12, 15, 20, 23]
       lowerCAmelCase__      =			len(A )

       # the best revenue comes from cutting the rod into 6 pieces, each
       # of length 1 resulting in a revenue of 6 * 6 = 36.
       lowerCAmelCase__      =			36

       lowerCAmelCase__      =			top_down_cut_rod(A				,					A )
       lowerCAmelCase__      =			bottom_up_cut_rod(A				,					A )
       lowerCAmelCase__      =			naive_cut_rod_recursive(A				,					A )

       assert expected_max_revenue == max_rev_top_down
       assert max_rev_top_down == max_rev_bottom_up
       assert max_rev_bottom_up == max_rev_naive


if __name__ == "__main__":
  main()



'''simple docstring'''






from collections import Counter
from timeit import timeit


def       _snake_case     (  A = ""				,					)		->					bool:
							return sum(c % 2 for c in Counter(input_str.replace(''' '''				,					'''''' ).lower() ).values() ) < 2


def       _snake_case     (  A = "" )		->					bool:
							if len(A ) == 0:
														return True
							lowerCAmelCase__      =			input_str.replace(''' '''				,					'''''' ).lower()
							# character_freq_dict: Stores the frequency of every character in the input string
							lowerCAmelCase__      =			{}

							for character in lower_case_input_str:
														lowerCAmelCase__      =			character_freq_dict.get(A				,					0 ) + 1
							lowerCAmelCase__      =			0

							for character_count in character_freq_dict.values():
														if character_count % 2:
																					odd_char += 1
							if odd_char > 1:
														return False
							return True


def       _snake_case     (  A = "" )		->					None:
							print('''\nFor string = '''				,					A				,					''':''' )
							print(
							    '''> can_string_be_rearranged_as_palindrome_counter()'''				,					'''\tans ='''				,					can_string_be_rearranged_as_palindrome_counter(A )				,					'''\ttime ='''				,					timeit(
							        '''z.can_string_be_rearranged_as_palindrome_counter(z.check_str)'''				,					setup='''import __main__ as z'''				,					)				,					'''seconds'''				,					)
							print(
							    '''> can_string_be_rearranged_as_palindrome()'''				,					'''\tans ='''				,					can_string_be_rearranged_as_palindrome(A )				,					'''\ttime ='''				,					timeit(
							        '''z.can_string_be_rearranged_as_palindrome(z.check_str)'''				,					setup='''import __main__ as z'''				,					)				,					'''seconds'''				,					)


if __name__ == "__main__":
		__UpperCAmelCase					       =							input(
		    '''Enter string to determine if it can be rearranged as a palindrome or not: '''
		).strip()
		benchmark(check_str)
		__UpperCAmelCase					       =							can_string_be_rearranged_as_palindrome_counter(check_str)
		print(f"""{check_str} can {'' if status else 'not '}be rearranged as a palindrome""")