const howMany = (str) => str
.toLowerCase()
.split("")
.sort()
.join("")
.match(/(.)1+/g)
const repet = (str, num) => {
const filter = howMany(str)
let result = ''
for (let i = 0; i < filter.length; i++) {
if (filter[i].length === num) {
result += filter[i].charAt(0)
}
}
return result
}