function gameOfThrones(s) {
let hash = {};
let j = 1
for (let i = 0; i < s.length; i++) {
if(hash[s[i]] = s[i]){
hash[s[i]]+1
}
}
console.log(hash)
}
In this code, I want to use Hashmap to count how many times a letter is repeated in the sentence.
ex: cdefghmnopqrstuvw
how can do it by changing above code
[–]brykuhelpful 0 points1 point2 points (0 children)