Clone Graph

Medium
Graphs DFS Hash
Implement the Clone Graph algorithm. Input: as specified Output: result

Constraints

Standard constraints apply.

Examples

Example 1:
Input: sample
Output:
Example 2:
Input: test
Output:

Hints

Consider a dfs approach.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.