





'''simple docstring'''

from __future__ import annotations





def lowerCamelCase						(     __lowerCamelCase :    str					,       __lowerCamelCase :    str    )						->bool:
    _SCREAMING_SNAKE_CASE									=			get_failure_array(__lowerCamelCase    )

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

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





def lowerCamelCase						(     __lowerCamelCase :    str    )						->list[int]:
    _SCREAMING_SNAKE_CASE									=			[0]
    _SCREAMING_SNAKE_CASE									=			0
    _SCREAMING_SNAKE_CASE									=			1
    while j < len(__lowerCamelCase    ):
        if pattern[i] == pattern[j]:
            i += 1
        elif i > 0:
            _SCREAMING_SNAKE_CASE									=			failure[i - 1]
            continue
        j += 1
        failure.append(__lowerCamelCase    )
    return failure


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

      # Test 2)
      lowercase_					= """ABABX"""
      lowercase_					= """ABABZABABYABABX"""
      assert kmp(pattern, text)

      # Test 3)
      lowercase_					= """AAAB"""
      lowercase_					= """ABAAAAAB"""
      assert kmp(pattern, text)

      # Test 4)
      lowercase_					= """abcdabcy"""
      lowercase_					= """abcxabcdabxabcdabcdabcy"""
      assert kmp(pattern, text)

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











def 						_a    (      a :int = 100 )							->			int:
 a		  =      n * (n + 1) * (2 * n + 1) / 6
 a		  =      (n * (n + 1) / 2) ** 2
 return int(square_of_sum - sum_of_squares )


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


