
"""simple docstring"""
from collections import Counter
from timeit import timeit
def 				a__   (   a   :				Optional[Any] = ""       ,     ):

  """simple docstring"""







  return sum(c % 2 for c in Counter(input_str.replace(" "       ,     ""		).lower()		).values()		) < 2
def 				a__   (   a   :				Optional[Any] = ""		):

  """simple docstring"""







  if len(__lowerCAmelCase		) == 0:
    return True
  _snake_case     :						Tuple						=   input_str.replace(" "       ,     ""		).lower()
  # character_freq_dict: Stores the frequency of every character in the input string
  _snake_case     :						dict[str, int]						=   {}

  for character in lower_case_input_str:
    _snake_case     :						int						=   character_freq_dict.get(__lowerCAmelCase       ,     0		) + 1
  _snake_case     :						Dict						=   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 				a__   (   a   :				List[str] = ""		):

  """simple docstring"""







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


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



"""simple docstring"""
from __future__ import annotations






class      _UpperCAmelCase				:
    def __init__(    self						,    snake_case_						,    snake_case_     ):
      _snake_case			,					_snake_case     :						Dict						=   text, pattern
      _snake_case			,					_snake_case     :						int						=   len(snake_case_     ), len(snake_case_     )
    def 					lowerCamelCase__	(    self						,    snake_case_     ):

      for i in range(self.patLen - 1						,    -1						,    -1     ):
        if char == self.pattern[i]:
          return i
      return -1
    def 					lowerCamelCase__	(    self						,    snake_case_     ):

      for i in range(self.patLen - 1						,    -1						,    -1     ):
        if self.pattern[i] != self.text[current_pos + i]:
          return current_pos + i
      return -1


    def 					lowerCamelCase__	(    self     ):
      # searches pattern in text and returns index positions
      _snake_case     :						List[str]						=   []
      for i in range(self.textLen - self.patLen + 1     ):
        _snake_case     :						Union[str, Any]						=   self.mismatch_in_text(snake_case_     )
        if mismatch_index == -1:
          positions.append(snake_case_     )
        else:
          _snake_case     :						Tuple						=   self.match_in_pattern(self.text[mismatch_index]     )
          _snake_case     :						Tuple						=   (
              mismatch_index - match_index
          )  # shifting index lgtm [py/multiple-definition]
      return positions


_a      :			List[Any]					=							"""ABAABA"""
_a      :			str					=							"""AB"""
_a      :			List[Any]					=							BoyerMooreSearch(text, pattern)
_a      :			Any					=							bms.bad_character_heuristic()

if len(positions) == 0:
    print("""No match found""")
else:
    print("""Pattern found in following positions: """)
    print(positions)

