refactor copy_list_with_random_pointer