Pergunta de entrevista da empresa GE HealthCare

Write a program to pick the LinkedList head stored in an array such that each list falls into the same group.