solution 2 for Clone Graph