

"""simple docstring"""




from __future__ import annotations


class 		_A							:





      def __init__(	self     ,    SCREAMING_SNAKE_CASE__		) ->       None:
         lowerCamelCase__						       =      value
         lowerCamelCase__						       =      None
         lowerCamelCase__						       =      None






class 		_A							:
      __a             =						42





      def __init__(	self		) ->       None:
         lowerCamelCase__						       =      0





      def        _lowerCamelCase	(	self     ,    SCREAMING_SNAKE_CASE__     ,    SCREAMING_SNAKE_CASE__		) ->       None:
         if node is None:
            return

         if path_sum == self.target:
            self.paths += 1

         if node.left:
            self.depth_first_search(node.left     ,    path_sum + node.left.value		)
         if node.right:
            self.depth_first_search(node.right     ,    path_sum + node.right.value		)





      def        _lowerCamelCase	(	self     ,    SCREAMING_SNAKE_CASE__     ,    SCREAMING_SNAKE_CASE__ = None		) ->       int:
         if node is None:
            return 0
         if target is not None:
            lowerCamelCase__						       =      target

         self.depth_first_search(SCREAMING_SNAKE_CASE__     ,    node.value		)
         self.path_sum(node.left		)
         self.path_sum(node.right		)

         return self.paths


if __name__ == "__main__":
     import doctest

     doctest.testmod()







"""simple docstring"""




SCREAMING_SNAKE_CASE_  :      Optional[int]							=      {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]}

SCREAMING_SNAKE_CASE_  :      str							=      {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []}



def 						UpperCAmelCase__ (					A__						,     A__						,     A__ )   ->   list:




   """simple docstring"""
   lowerCamelCase__						       =      True
   lowerCamelCase__						       =      []

   for neighbour in graph[vert]:
      if not visited[neighbour]:
         connected_verts += dfs(A__						,     A__						,     A__ )

   return [vert, *connected_verts]



def 						UpperCAmelCase__ (					A__ )   ->   list:




   """simple docstring"""
   lowerCamelCase__						       =      len(A__ )
   lowerCamelCase__						       =      graph_size * [False]
   lowerCamelCase__						       =      []

   for i in range(A__ ):
      if not visited[i]:
         lowerCamelCase__						       =      dfs(A__						,     A__						,     A__ )
         components_list.append(A__ )

   return components_list


if __name__ == "__main__":
     import doctest

     doctest.testmod()




