

"""simple docstring"""



class 					a						:



    """simple docstring"""



    def __init__(     self: Any    ,						UpperCamelCase: list       ):






         """simple docstring"""


         A__										=  set_counts
         A__										=  max(UpperCamelCase       )
         A__										=  len(UpperCamelCase       )
         A__										=  [1] * num_sets
         A__										=  list(range(UpperCamelCase       )       )

    def 				UpperCamelCase	(     self: Any    ,						UpperCamelCase: int    ,						UpperCamelCase: int       ):






         """simple docstring"""


         A__										=  self.get_parent(UpperCamelCase       )
         A__										=  self.get_parent(UpperCamelCase       )

         if src_parent == dst_parent:
              return False

         if self.ranks[dst_parent] >= self.ranks[src_parent]:
              self.set_counts[dst_parent] += self.set_counts[src_parent]
              A__										=  0
              A__										=  dst_parent
              if self.ranks[dst_parent] == self.ranks[src_parent]:
                   self.ranks[dst_parent] += 1
              A__										=  self.set_counts[dst_parent]
         else:
              self.set_counts[src_parent] += self.set_counts[dst_parent]
              A__										=  0
              A__										=  src_parent
              A__										=  self.set_counts[src_parent]

         A__										=  max(self.max_set    ,						UpperCamelCase       )
         return True





    def 				UpperCamelCase	(     self: Tuple    ,						UpperCamelCase: int       ):






         """simple docstring"""


         if self.parents[disj_set] == disj_set:
              return disj_set
         A__										=  self.get_parent(self.parents[disj_set]       )
         return self.parents[disj_set]









"""simple docstring"""



from __future__ import annotations



class 					a						:



    """simple docstring"""



    def __init__(     self: Any    ,						UpperCamelCase: str    ,						UpperCamelCase: str       ):






         """simple docstring"""


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

    def 				UpperCamelCase	(     self: Dict    ,						UpperCamelCase: str       ):






         """simple docstring"""


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

    def 				UpperCamelCase	(     self: str    ,						UpperCamelCase: 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 				UpperCamelCase	(     self: List[Any]       ):






         """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

SCREAMING_SNAKE_CASE_					:	List[Any]							  =						'ABAABA'
SCREAMING_SNAKE_CASE_					:	List[Any]							  =						'AB'
SCREAMING_SNAKE_CASE_					:	Union[str, Any]							  =						BoyerMooreSearch(text, pattern)
SCREAMING_SNAKE_CASE_					:	int							  =						bms.bad_character_heuristic()

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






