'''simple docstring'''

def __UpperCamelCase( _A       :					str     ):
   '''simple docstring'''
   UpperCAmelCase__				:					Tuple 					=	[0 for i in range(len(_A     )     )]

   # initialize interval's left pointer and right pointer
   UpperCAmelCase__					,   UpperCAmelCase__				:					Optional[Any] 					=	0, 0

   for i in range(1	,      len(_A     )     ):
      # case when current index is inside the interval
      if i <= right_pointer:
         UpperCAmelCase__				:					Tuple 					=	min(right_pointer - i + 1	,      z_result[i - left_pointer]     )
         UpperCAmelCase__				:					str 					=	min_edge

      while go_next(_A	,      _A	,      _A     ):
         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:
         UpperCAmelCase__					,   UpperCAmelCase__				:					Any 					=	i, i + z_result[i] - 1

   return z_result







def __UpperCamelCase( _A       :					int	,      _A       :					list[int]	,      _A       :					str     ):
   '''simple docstring'''
   return i + z_result[i] < len(_A     ) and s[z_result[i]] == s[i + z_result[i]]







def __UpperCamelCase( _A       :					str	,      _A       :					str     ):
   '''simple docstring'''
   UpperCAmelCase__				:					str 					=	0
   # concatenate 'pattern' and 'input_str' and call z_function
   # with concatenated string
   UpperCAmelCase__				:					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(_A     ):
         answer += 1

   return answer


if __name__ == "__main__":
  import doctest

  doctest.testmod()





'''simple docstring'''

def __UpperCamelCase( _A       :					float	,      _A       :					list[float]     ):
   '''simple docstring'''
   if discount_rate < 0:
      raise ValueError('''Discount rate cannot be negative'''     )
   if not cash_flows:
      raise ValueError('''Cash flows list cannot be empty'''     )
   UpperCAmelCase__				:					str 					=	sum(
       cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(_A     )     )
   return round(_A	,      ndigits=2     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()




