cpp implementation of Remove Duplicates From Sorted List II