checking the code for removing duplicate char from string