






from __future__ import annotations





def        _snake_case   (_snake_case				:       list[int]      ,    _snake_case				:       int)					->	int:
   if len(_snake_case) < k or k < 0:
      raise ValueError('Invalid Input')
   _lowercase              =_lowercase              =sum(array[:k])
   for i in range(len(_snake_case) - k):
      _lowercase              =current_sum - array[i] + array[i + k]
      _lowercase              =max(_snake_case      ,    _snake_case)
   return max_sum


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

    testmod()
    _SCREAMING_SNAKE_CASE   =  [randint(-10_00, 10_00) for i in range(1_00)]
    _SCREAMING_SNAKE_CASE   =  randint(0, 1_10)
    print(f'''The maximum sum of {k} consecutive elements is {max_sum_in_array(array,k)}''')










class 					SCREAMING_SNAKE_CASE_  :
       """simple docstring"""


       def __init__(				self	:List[Any]):



          """simple docstring"""

          _lowercase              ={}





       def 				UpperCamelCase__						(				self	:str):



          """simple docstring"""

          print(self.vertex)
          for i in self.vertex:
             print(snake_case,      ' -> ',      ' -> '.join([str(snake_case) for j in self.vertex[i]]))





       def 				UpperCamelCase__						(				self	:Any,      snake_case	:int,      snake_case	:int):



          """simple docstring"""

          if from_vertex in self.vertex:
             self.vertex[from_vertex].append(snake_case)
          else:
             # else make a new vertex
             _lowercase              =[to_vertex]





       def 				UpperCamelCase__						(				self	:Union[str, Any]):



          """simple docstring"""

          _lowercase              =[False] * len(self.vertex)

          # call the recursive helper function
          for i in range(len(self.vertex)):
             if not visited[i]:
                self.dfs_recursive(snake_case,      snake_case)





       def 				UpperCamelCase__						(				self	:List[str],      snake_case	:int,      snake_case	:list):



          """simple docstring"""

          _lowercase              =True

          print(snake_case,      end=' ')

          # Recur for all the vertices that are adjacent to this node
          for i in self.vertex:
             if not visited[i]:
                self.dfs_recursive(snake_case,      snake_case)


if __name__ == "__main__":
    _SCREAMING_SNAKE_CASE   =  Graph()
    g.add_edge(0, 1)
    g.add_edge(0, 2)
    g.add_edge(1, 2)
    g.add_edge(2, 0)
    g.add_edge(2, 3)
    g.add_edge(3, 3)

    g.print_graph()
    print("DFS:")
    g.dfs()

    # OUTPUT:
    # 0  ->  1 -> 2
    # 1  ->  2
    # 2  ->  0 -> 3
    # 3  ->  3
    # DFS:
    #  0 1 2 3


