



'''simple docstring'''





def        a_     (							_lowerCAmelCase       )      ->      list[int]:
  __lowerCamelCase       :       Optional[int]           = [0 for i in range(len(_lowerCAmelCase       )       )]

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

  for i in range(1       ,len(_lowerCAmelCase       )       ):
    # 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       :       Any           = min_edge

    while go_next(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ):
      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       ,__lowerCamelCase       :       str           = i, i + z_result[i] - 1

  return z_result

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       )      ->      bool:
  return i + z_result[i] < len(_lowerCAmelCase       ) and s[z_result[i]] == s[i + z_result[i]]

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      int:
  __lowerCamelCase       :       str           = 0
  # concatenate 'pattern' and 'input_str' and call z_function
  # with concatenated string
  __lowerCamelCase       :       Dict           = 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(_lowerCAmelCase       ):
      answer += 1

  return answer


if __name__ == "__main__":
   import doctest

   doctest.testmod()











'''simple docstring'''





_UpperCamelCase											=						tuple[float, float, float]
_UpperCamelCase											=						tuple[float, float, float]

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Vectorad:
  __lowerCamelCase       :       Any           = end_pointa[0] - end_pointa[0]
  __lowerCamelCase       :       str           = end_pointa[1] - end_pointa[1]
  __lowerCamelCase       :       Tuple           = end_pointa[2] - end_pointa[2]
  return (x, y, z)

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Vectorad:
  __lowerCamelCase       :       List[str]           = ab[1] * ac[2] - ab[2] * ac[1]  # *i
  __lowerCamelCase       :       Dict           = (ab[0] * ac[2] - ab[2] * ac[0]) * -1  # *j
  __lowerCamelCase       :       List[Any]           = ab[0] * ac[1] - ab[1] * ac[0]  # *k
  return (x, y, z)

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      bool:
  return tuple(round(_lowerCAmelCase       ,_lowerCAmelCase       ) for x in vector       ) == (0, 0, 0)


def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase = 10       )      ->      bool:
  __lowerCamelCase       :       str           = create_vector(_lowerCAmelCase       ,_lowerCAmelCase       )
  __lowerCamelCase       :       Dict           = create_vector(_lowerCAmelCase       ,_lowerCAmelCase       )
  return is_zero_vector(get_ad_vectors_cross(_lowerCAmelCase       ,_lowerCAmelCase       )       ,_lowerCAmelCase       )






