Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solution(s) {
- let pC = 0;
- let yC = 0;
- s.toLowerCase().split("").forEach((l) => {
- if (l === "p") pC++;
- else if (l === "y") yC++;
- })
- return pC === yC ? true : false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement