EPAM Systems interview question

LinkedList problem on Leetcode,medium difficulty