added solutions for remove dups problems