





from __future__ import annotations




def  __UpperCAmelCase(   lowercase_			,     lowercase_   ):
       _lowerCamelCase				:  List[str]						=		get_failure_array(lowercase_   )

       # 2) Step through text searching for pattern
       _lowerCamelCase,	_lowerCamelCase				:  Dict						=		0, 0  # index into text, pattern
       while i < len(lowercase_   ):
              if pattern[j] == text[i]:
                     if j == (len(lowercase_   ) - 1):
                            return True
                     j += 1

              # if this is a prefix in our pattern
              # just go back far enough to continue
              elif j > 0:
                     _lowerCamelCase				:  Dict						=		failure[j - 1]
                     continue
              i += 1
       return False




def  __UpperCAmelCase(   lowercase_   ):
       _lowerCamelCase				:  List[str]						=		[0]
       _lowerCamelCase				:  Optional[Any]						=		0
       _lowerCamelCase				:  Any						=		1
       while j < len(lowercase_   ):
              if pattern[i] == pattern[j]:
                     i += 1
              elif i > 0:
                     _lowerCamelCase				:  List[str]						=		failure[i - 1]
                     continue
              j += 1
              failure.append(lowercase_   )
       return failure


if __name__ == "__main__":
       # Test 1)
       _lowerCamelCase      							=   'abc1abc12'
       _lowerCamelCase      							=   'alskfjaldsabc1abc1abc12k23adsfabcabc'
       _lowerCamelCase      							=   'alskfjaldsk23adsfabcabc'
       assert kmp(pattern, texta) and not kmp(pattern, texta)

       # Test 2)
       _lowerCamelCase      							=   'ABABX'
       _lowerCamelCase      							=   'ABABZABABYABABX'
       assert kmp(pattern, text)

       # Test 3)
       _lowerCamelCase      							=   'AAAB'
       _lowerCamelCase      							=   'ABAAAAAB'
       assert kmp(pattern, text)

       # Test 4)
       _lowerCamelCase      							=   'abcdabcy'
       _lowerCamelCase      							=   'abcxabcdabxabcdabcdabcy'
       assert kmp(pattern, text)

       # Test 5)
       _lowerCamelCase      							=   'aabaabaaa'
       assert get_failure_array(pattern) == [0, 1, 0, 1, 2, 3, 4, 5, 2]








def  __UpperCAmelCase(   lowercase_			,     lowercase_   ):
       # "extended trapezoidal rule"
       # int(f) = dx/2 * (f1 + 2f2 + ... + fn)
       _lowerCamelCase				:  int						=		(boundary[1] - boundary[0]) / steps
       _lowerCamelCase				:  Any						=		boundary[0]
       _lowerCamelCase				:  Tuple						=		boundary[1]
       _lowerCamelCase				:  Optional[Any]						=		make_points(lowercase_			,     lowercase_			,     lowercase_   )
       _lowerCamelCase				:  Dict						=		0.0
       y += (h / 2.0) * f(lowercase_   )
       for i in x_i:
              # print(i)
              y += h * f(lowercase_   )
       y += (h / 2.0) * f(lowercase_   )
       return y




def  __UpperCAmelCase(   lowercase_			,     lowercase_			,     lowercase_   ):
       _lowerCamelCase				:  Dict						=		a + h
       while x < (b - h):
              yield x
              _lowerCamelCase				:  Dict						=		x + h




def  __UpperCAmelCase(   lowercase_   ):  # enter your function here
       _lowerCamelCase				:  List[str]						=		(x - 0) * (x - 0)
       return y




def  __UpperCAmelCase(   ):
       _lowerCamelCase				:  List[Any]						=		0.0  # Lower bound of integration
       _lowerCamelCase				:  Union[str, Any]						=		1.0  # Upper bound of integration
       _lowerCamelCase				:  Dict						=		1_0.0  # define number of steps or resolution
       _lowerCamelCase				:  Optional[int]						=		[a, b]  # define boundary of integration
       _lowerCamelCase				:  str						=		method_a(lowercase_			,     lowercase_   )
       print(F"""y = {y}"""   )


if __name__ == "__main__":
       main()

