This challenge comes courtesy of LeetCode: https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/
The challenge is rated medium difficulty. At this time there have been 96,122 accepted solutions from 334,885 submissions. If you decide to tackle the challenge make sure you read it a few times.
On my first pass (which I did not submit) I missed the word ‘distinct’ from the requirements ;o(
On purpose, my solution completely ignores the fact that the list is ‘sorted’. If this would have been work or a contest I would have taken such requirement into consideration :o)
Continue reading “Remove Duplicates from Sorted List II”