HubSpot interview question

copy elements from 1 array into another and then from 1 linked list into another