function solution4(s) {
let count = 0;
for (let c of s) {
if (c === "p" || c === "P") count++;
if (c === "y" || c === "Y") count--;
}
return count === 0 ? true : false;
}
Level
프로그래머스 Lv1
Recruitment
function solution4(s) {
let count = 0;
for (let c of s) {
if (c === "p" || c === "P") count++;
if (c === "y" || c === "Y") count--;
}
return count === 0 ? true : false;
}