remoe duplicate char problem solution