Coviam interview question

Remove duplicate from Array with k repetition