LeetCode | Linked Lists and stacks part 4 | first half