




'''simple docstring'''

from itertools import product


def __UpperCAmelCase	(   _UpperCAmelCase		:   int		,				_UpperCAmelCase		:   int						)      ->      list[int]:
			__snake_case			=		sides_number
			__snake_case			=		max_face_number * dice_number
			__snake_case			=		[0] * (max_total + 1)

			__snake_case			=		1
			__snake_case			=		range(_UpperCAmelCase		,				max_face_number + 1						)
			for dice_numbers in product(_UpperCAmelCase		,				repeat=_UpperCAmelCase						):
						__snake_case			=		sum(_UpperCAmelCase						)
						totals_frequencies[total] += 1

			return totals_frequencies


def __UpperCAmelCase	(   )      ->      float:
			__snake_case			=		total_frequency_distribution(
			    sides_number=4		,				dice_number=9						)
			__snake_case			=		total_frequency_distribution(
			    sides_number=6		,				dice_number=6						)

			__snake_case			=		0
			__snake_case			=		9
			__snake_case			=		4 * 9
			__snake_case			=		6
			for peter_total in range(_UpperCAmelCase		,				max_peter_total + 1						):
						peter_wins_count += peter_totals_frequencies[peter_total] * sum(
						    colin_totals_frequencies[min_colin_total:peter_total]						)

			__snake_case			=		(4**9) * (6**6)
			__snake_case			=		peter_wins_count / total_games_number

			__snake_case			=		round(_UpperCAmelCase		,				ndigits=7						)

			return rounded_peter_win_probability


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






from __future__ import annotations
class SCREAMING_SNAKE_CASE_		:







   def __init__(     self						:						Dict   ,   lowerCamelCase_						:						str   ,   lowerCamelCase_						:						str				):





    """simple docstring"""


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







   def 						lowerCamelCase_	(     self						:						List[Any]   ,   lowerCamelCase_						:						str				):





    """simple docstring"""


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







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





    """simple docstring"""


    UpperCamelCase			  =      []
    for i in range(self.textLen - self.patLen + 1				):
     UpperCamelCase			  =      self.mismatch_in_text(lowerCamelCase_				)
     if mismatch_index == -1:
      positions.append(lowerCamelCase_				)
     else:
      UpperCamelCase			  =      self.match_in_pattern(self.text[mismatch_index]				)
      UpperCamelCase			  =      (
          mismatch_index - match_index
      )  # shifting index lgtm [py/multiple-definition]
    return positions





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

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