Java 풀이
class Solution {
boolean solution(String s) {
boolean answer = true;
int nump = 0;
int numy = 0;
char temp;
for(int i = 0; i < s.length(); i++) {
temp = s.charAt(i);
if(temp == 'p' || temp == 'P') {
nump++;
}
if(temp == 'y' || temp == 'Y') {
numy++;
}
}
if(nump == numy) {
answer = true;
} else {
answer = false;
}
return answer;
}
}