Pergunta de entrevista da empresa UKG

leetcode easy question, mostly using lists and linkedlists