Solved LeetCode program · 26 of 1,000
#0026 · Remove Duplicates from Sorted Array
Original English source
Start with the list of numbers 0, 0, 1, 1, 1, 2, 2, 3, 3, and 4. The unique is an empty list of whole numbers. For each number in the list, if unique does not contain the number, Place number into unique. Report the number of items in unique. For each number in unique, report number.
Expected stdout
5 0 1 2 3 4