Adding 2-3 solution for singly linked list.