function GetAllRepeatingCharacters(str : string) {
const repeating : any = {};
for (const ch of str) {
repeating[ch] = (repeating[ch] || 0) + 1;
}
return Object.entries(repeating).filter(ch => ch[1] > 1).map(ch => ch[0]);
}
const s : string = "java c c++ csharp typescript php python";
console.log(GetAllRepeatingCharacters(s));
/*
run:
["a", " ", "c", "+", "s", "h", "r", "p", "t", "y"]
*/