class Solution {
public int solution(String s) {
boolean answer = true;
String[] sArr = s.split("");
int countP = 0, countY = 0;
for(int i = 0; i < sArr.length; i++) {
if(sArr[i].equals("P") || sArr[i].equals("p")) {
countP++;
}else if(sArr[i].equals("Y") || sArr[i].equals("y")) {
countY++;
}
}
if(countP != countY){
answer = false;
}
return answer;
}
}