Solvative interview question

Normal javascript questions remove duplicates