leetle

Daily challenge for 2025-09-27

270. Clone Graph

Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a value (int) and a list of its neighbors. For this problem, return the sum of all node values in the cloned graph.

Example:
Input: adjList = [[2,4],[1,3],[2,4],[1,3]]
Output: 10

The graph has 4 nodes with values 1,2,3,4. Sum = 1+2+3+4 = 10

Run this challenge interactively in Python or JavaScript when the app loads.