




from __future__ import annotations


class 							UpperCamelCase_       :

    '''simple docstring'''






    def __init__(     self :      str   ,					UpperCAmelCase__ :      str   ,					UpperCAmelCase__ :      str)		->Any:





           '''simple docstring'''

           A__					,				A__ 					=       text, pattern
           A__					,				A__ 					=       len(UpperCAmelCase__), len(UpperCAmelCase__)


    def 			SCREAMING_SNAKE_CASE				(     self :      str   ,					UpperCAmelCase__ :      str)		->int:





           '''simple docstring'''

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


    def 			SCREAMING_SNAKE_CASE				(     self :      List[Any]   ,					UpperCAmelCase__ :      int)		->int:





           '''simple docstring'''

           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 			SCREAMING_SNAKE_CASE				(     self :      Union[str, Any])		->list[int]:





           '''simple docstring'''

           A__ 					=       []
           for i in range(self.textLen - self.patLen + 1):
                  A__ 					=       self.mismatch_in_text(UpperCAmelCase__)
                  if mismatch_index == -1:
                         positions.append(UpperCAmelCase__)
                  else:
                         A__ 					=       self.match_in_pattern(self.text[mismatch_index])
                         A__ 					=       (
                             mismatch_index - match_index
                         )  # shifting index lgtm [py/multiple-definition]
           return positions
_lowerCamelCase      :						Any							=  """ABAABA"""
_lowerCamelCase      :						Dict							=  """AB"""
_lowerCamelCase      :						List[Any]							=  BoyerMooreSearch(text, pattern)
_lowerCamelCase      :						Any							=  bms.bad_character_heuristic()

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






def 	__lowerCamelCase						(							lowerCamelCase__		:						int      ):





			'''simple docstring'''




			lowerCamelCase    		=  (1 + 24 * n) ** 0.5
			return ((1 + root) / 6) % 1 == 0






def 	__lowerCamelCase						(							lowerCamelCase__		:						int = 5000      ):





			'''simple docstring'''




			lowerCamelCase    		=  [(i * (3 * i - 1)) // 2 for i in range(1  ,							lowerCamelCase__      )]
			for i, pentagonal_i in enumerate(lowerCamelCase__      ):
						for j in range(lowerCamelCase__  ,							len(lowerCamelCase__      )      ):
									lowerCamelCase    		=  pentagonal_nums[j]
									lowerCamelCase    		=  pentagonal_i + pentagonal_j
									lowerCamelCase    		=  pentagonal_j - pentagonal_i
									if is_pentagonal(lowerCamelCase__      ) and is_pentagonal(lowerCamelCase__      ):
												return b

			return -1


if __name__ == "__main__":
		print(f"""{solution() = }""")

