주어진 문자열에서 포함된 p와 y의 개수를 비교하는 문제이다.
문자열 s가 "pPoooyY"인 경우, 리턴값은 true이다.
class Solution {
boolean solution(String s) {
boolean answer = true;
String str = s.toLowerCase();
int cntP = str.replace("p", "").length();
int cntY = str.replace("y", "").length();
if(cntP != cntY) answer = false;
return answer;
}
}