Pregunta de entrevista de Oracle

take a string and an integer to a function and return the string after removing all repetative characters which is exceeding the integer