
from __future__ import annotations






def   lowerCamelCase__							(					a		,		a      )      ->   int:
   if len(_UpperCAmelCase      ) < k or k < 0:
      raise ValueError('''Invalid Input'''      )
   _A:  Optional[int]					=       sum(array[:k]      )
   for i in range(len(_UpperCAmelCase      ) - k      ):
      _A:  str					=       current_sum - array[i] + array[i + k]
      _A:  List[str]					=       max(_UpperCAmelCase		,		_UpperCAmelCase      )
   return max_sum


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

   testmod()
   UpperCAmelCase__		:     List[Any]     			=      [randint(-1000, 1000) for i in range(100)]
   UpperCAmelCase__		:     Optional[int]     			=      randint(0, 110)
   print(F"""The maximum sum of {k} consecutive elements is {max_sum_in_array(array,k)}""")










from __future__ import annotations

from typing import Any


def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase )			->     None:
    create_state_space_tree(_UpperCAmelCase						,	[]						,	0 )


def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase						,	_UpperCAmelCase						,	_UpperCAmelCase )			->     None:

    if index == len(_UpperCAmelCase ):
        print(_UpperCAmelCase )
        return

    create_state_space_tree(_UpperCAmelCase						,	_UpperCAmelCase						,	index + 1 )
    current_subsequence.append(sequence[index] )
    create_state_space_tree(_UpperCAmelCase						,	_UpperCAmelCase						,	index + 1 )
    current_subsequence.pop()


if __name__ == "__main__":
    _UpperCAmelCase				:       list[Any]	   =				[3, 1, 2, 4]
    generate_all_subsequences(seq)

    seq.clear()
    seq.extend(["""A""", """B""", """C"""])
    generate_all_subsequences(seq)





