Pergunta de entrevista da empresa Morgan Stanley

Onsite#6 Return all characters from a string which appeared more than once

Resposta da entrevista

Sigiloso

12 de nov. de 2018

Maintain a HashSet while iterating over a character array, if hashset already has character then add it into resulting ArrayList. An alternate approach is to maintain a counter for each character in a hashmap and then iterate over hashmap and return all elements appears more than x # of times.