SpanIdea interview question

Repeated elements in a linkedlist