copy the thought from previous removeDuplicates.
format change
I think it is O(n) in the worst situation
Merge pull request #2 from hex108/master

good catch!