TikTok interview question

Clone a graph and return a copy (coding)