rewrite leetcode clone graph