Remove Dups

Write a function to remove all duplicate characters
with extra space
without extra space