function getMaxCharacters(str) {
const map = {}
var arr = str.match(/(\w)\1+/g)
var max = arr[0].length
arr.map(v => max = Math.max(max, v.length))
const maxArr = arr.filter(v => v.length === max)
maxArr.forEach(v => {
map[v[0]] = v.length
})
return map
}

getMaxCharacters('abcaakjbb') // { a: 2, b: 2 }

console.log(getMaxCharacters('abcaakjbb'))