
from collections import Counter
from timeit import timeit






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




			"""simple docstring"""


			return sum(c % 2 for c in Counter(input_str.replace(" "					,							""       ).lower()       ).values()       ) < 2






def      lowerCamelCase__       (       __lowerCAmelCase						:						str = ""       ):




			"""simple docstring"""


			if len(__UpperCamelCase       ) == 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(__UpperCamelCase					,							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      lowerCamelCase__       (       __lowerCAmelCase						:						str = ""       ):




			"""simple docstring"""


			print("\nFor string = "					,							__UpperCamelCase					,							":"       )
			print(
			    "> can_string_be_rearranged_as_palindrome_counter()"					,							"\tans ="					,							can_string_be_rearranged_as_palindrome_counter(__UpperCamelCase       )					,							"\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(__UpperCamelCase       )					,							"\ttime ="					,							timeit(
			        "z.can_string_be_rearranged_as_palindrome(z.check_str)"					,							setup="import __main__ as z"					,							)					,							"seconds"					,							)


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





def      lowerCamelCase__       (       __lowerCAmelCase						:						int       ):




			"""simple docstring"""


			if upper_limit < 0:
						raise ValueError("Limit for the Catalan sequence must be ≥ 0"       )

			lowerCAmelCase_      			=			[0] * (upper_limit + 1)

			# Base case: C(0) = C(1) = 1
			lowerCAmelCase_      			=			1
			if upper_limit > 0:
						lowerCAmelCase_      			=			1

			# Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i
			for i in range(2					,							upper_limit + 1       ):
						for j in range(__lowerCAmelCase       ):
									catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]

			return catalan_list


if __name__ == "__main__":
			print("\n********* Catalan Numbers Using Dynamic Programming ************\n")
			print("\n*** Enter -1 at any time to quit ***")
			print("\nEnter the upper limit (≥ 0) for the Catalan number sequence: ", end="")
			try:
						while True:
									_A     =  int(input().strip())
									if N < 0:
												print("\n********* Goodbye!! ************")
												break
									else:
												print(f"""The Catalan numbers from 0 through {N} are:""")
												print(catalan_numbers(N))
												print("Try another upper limit for the sequence: ", end="")
			except (NameError, ValueError):
						print("\n********* Invalid input, goodbye! ************\n")

			import doctest

			doctest.testmod()



