Walmart Interview Question

Leet code linked list problem