Capital One interview question

Linked lists/string manip.