Walmart interview question

Leet code linked list problem