






"""simple docstring"""


def 					lowerCAmelCase				(    __UpperCamelCase ):




  """simple docstring"""







  if any(not isinstance(__UpperCamelCase		,       __UpperCamelCase ) or x < 0 for x in sequence ):
    raise TypeError('''Sequence must be list of non-negative integers''' )
  for _ in range(len(__UpperCamelCase ) ):
    for i, (rod_upper, rod_lower) in enumerate(zip(__UpperCamelCase		,       sequence[1:] ) ):
      if rod_upper > rod_lower:
        sequence[i] -= rod_upper - rod_lower
        sequence[i + 1] += rod_upper - rod_lower
  return sequence


if __name__ == "__main__":
       assert bead_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]
       assert bead_sort([7, 9, 4, 3, 5]) == [3, 4, 5, 7, 9]












"""simple docstring"""


class 					snake_case		:


   '''simple docstring'''

   def __init__(	self :     List[str],       _lowerCamelCase :     list[int]  ):

     '''simple docstring'''
     __A									= len(_lowerCamelCase  )
     __A									= [0] * len_array

     if len_array > 0:
       __A									= array[0]

     for i in range(1,       _lowerCamelCase  ):
       __A									= self.prefix_sum[i - 1] + array[i]


   def 				_SCREAMING_SNAKE_CASE				(	self :     List[Any],       _lowerCamelCase :     int,       _lowerCamelCase :     int  ):

     '''simple docstring'''
     if start == 0:
       return self.prefix_sum[end]

     return self.prefix_sum[end] - self.prefix_sum[start - 1]






   def 				_SCREAMING_SNAKE_CASE				(	self :     List[str],       _lowerCamelCase :     int  ):

     '''simple docstring'''
     __A									= {0}
     for sum_item in self.prefix_sum:
       if sum_item - target_sum in sums:
         return True

       sums.add(_lowerCamelCase  )

     return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()




