


'''simple docstring'''



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				Optional[Any]							)     ->		list[int]:
     __lowerCamelCase   :	Optional[Any]								=		[0 for i in range(len(__snake_case							)							)]

     # initialize interval's left pointer and right pointer
     __lowerCamelCase   :	Dict								=		0, 0

     for i in range(1      ,    len(__snake_case							)							):
          # case when current index is inside the interval
          if i <= right_pointer:
               __lowerCamelCase   :	Optional[Any]								=		min(right_pointer - i + 1      ,    z_result[i - left_pointer]							)
               __lowerCamelCase   :	int								=		min_edge

          while go_next(__snake_case      ,    __snake_case      ,    __snake_case							):
               z_result[i] += 1

          # if new index's result gives us more right interval,
          # we've to update left_pointer and right_pointer
          if i + z_result[i] - 1 > right_pointer:
               __lowerCamelCase   :	Optional[int]								=		i, i + z_result[i] - 1

     return z_result



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				Optional[int]      ,    UpperCAmelCase_    :				Tuple      ,    UpperCAmelCase_    :				int							)     ->		bool:
     return i + z_result[i] < len(__snake_case							) and s[z_result[i]] == s[i + z_result[i]]



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				List[str]      ,    UpperCAmelCase_    :				Dict							)     ->		int:
     __lowerCamelCase   :	Dict								=		0
     # concatenate 'pattern' and 'input_str' and call z_function
     # with concatenated string
     __lowerCamelCase   :	List[str]								=		z_function(pattern + input_str							)

     for val in z_result:
          # if value is greater then length of the pattern string
          # that means this index is starting position of substring
          # which is equal to pattern string
          if val >= len(__snake_case							):
               answer += 1

     return answer


if __name__ == "__main__":
      import doctest

      doctest.testmod()











"""simple docstring"""






import re


def 			_lowercase				(  __snake_case	)						->   str:

			if len(re.findall("[ATCG]"					,__snake_case	)	) != len(__snake_case	):
						raise ValueError("Invalid Strand"	)

			return dna.translate(dna.maketrans("ATCG"					,"TAGC"	)	)


if __name__ == "__main__":
	import doctest

	doctest.testmod()