



"""simple docstring"""





from __future__ import annotations
def      a__			(   lowerCAmelCase__			,    lowerCAmelCase__   ):
      if len(lowerCAmelCase__   ) < k or k < 0:
            raise ValueError("Invalid Input"   )
      UpperCAmelCase_    				=							UpperCAmelCase_    				=							sum(array[:k]   )
      for i in range(len(lowerCAmelCase__   ) - k   ):
            UpperCAmelCase_    				=							current_sum - array[i] + array[i + k]
            UpperCAmelCase_    				=							max(lowerCAmelCase__			,    lowerCAmelCase__   )
      return max_sum


if __name__ == "__main__":
 from doctest import testmod
 from random import randint

 testmod()
 lowerCamelCase      =		[randint(-1_000, 1_000) for i in range(100)]
 lowerCamelCase      =		randint(0, 110)
 print(F"The maximum sum of {k} consecutive elements is {max_sum_in_array(array,k)}")









"""simple docstring"""





from __future__ import annotations
def      a__			(   lowerCAmelCase__   ):
      if len(lowerCAmelCase__   ) == 0:
            return []
      UpperCAmelCase_				,					UpperCAmelCase_    				=							min(lowerCAmelCase__   ), max(lowerCAmelCase__   )
      UpperCAmelCase_    				=							int(max_value - min_value   ) + 1
      UpperCAmelCase_    				=							[[] for _ in range(lowerCAmelCase__   )]

      for i in my_list:
            buckets[int(i - min_value   )].append(lowerCAmelCase__   )

      return [v for bucket in buckets for v in sorted(lowerCAmelCase__   )]


if __name__ == "__main__":
  from doctest import testmod

  testmod()
  assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
  assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]




