




'''simple docstring'''


from __future__ import annotations





class  __lowercase    :







   def __init__(						self   ,				UpperCamelCase   ,				UpperCamelCase   )					->     int:
     __a						,							__a								=       text, pattern
     __a						,							__a								=       len(A_   ), len(A_   )







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   )					->     int:

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







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   )					->     int:

     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[int]:
     # searches pattern in text and returns index positions
     __a								=       []
     for i in range(self.textLen - self.patLen + 1   ):
       __a								=       self.mismatch_in_text(A_   )
       if mismatch_index == -1:
         positions.append(A_   )
       else:
         __a								=       self.match_in_pattern(self.text[mismatch_index]   )
         __a								=       (
             mismatch_index - match_index
         )  # shifting index lgtm [py/multiple-definition]
     return positions

UpperCAmelCase_					=   "ABAABA"
UpperCAmelCase_					=   "AB"
UpperCAmelCase_					=   BoyerMooreSearch(text, pattern)
UpperCAmelCase_					=   bms.bad_character_heuristic()

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





"""simple docstring"""


import os

# Precomputes a list of the 100 first triangular numbers
_lowercase				 =					[int(0.5 * n * (n + 1)) for n in range(1, 1_01)]






def    _snake_case					(		):
	A     = os.path.dirname(os.path.realpath(snake_case__  )  )
	A     = os.path.join(snake_case__						,   'words.txt'  )

	A     = ''
	with open(snake_case__  ) as f:
		A     = f.readline()

	A     = [word.strip('"'  ) for word in words.strip('\r\n'  ).split(','  )]
	A     = [
	    word
	    for word in [sum(ord(snake_case__  ) - 64 for x in word  ) for word in words]
	    if word in TRIANGULAR_NUMBERS
	]
	return len(snake_case__  )


if __name__ == "__main__":
		print(solution())