Pergunta de entrevista da empresa Alteos

Leetcode linked list question, only one solution was acceptable. Big O played no role in the solution somehow.