Комментарии:
I took one day to struggle with this concept....but after watching this video you made it so understandable and i got the concept and logic....this is just perfect!!!!!!!!!!!!
ОтветитьYou explained this so well, even i understood it
ОтветитьBrilliant approach, never considered that object keys would be used this way. Also using || for the array initialization is also very clean. We could also put the max checking inside the loop to avoid another run through of the array like this:
let maxCount = 0
let maxChar = null
for(char of lcStr){
freqCounter[char] = freqCounter[char] + 1 || 1
if(freqCounter[char] > maxCount){
maxCount = freqCounter[char]
maxChar = char
}
}
Although it won't affect Big O regardless.
From your channel will be a perfect free source mate. I also learn a lot from your videos. Keep rocking mate :)
Ответить