문제 링크 : Percentage of Letter in String
/**
* @param {string} s
* @param {character} letter
* @return {number}
*/
var percentageLetter = function(s, letter) {
let cnt = 0
for(let el of s) {
if(el === letter) cnt += 1
}
return Math.floor(cnt/s.length * 100)
};
/**
* @param {string} s
* @param {character} letter
* @return {number}
*/
var percentageLetter = function(s, letter) {
let count = s.split(letter).length-1
return Math.floor(count/s.length*100)
};