class Solution {
boolean solution(String s) {
int a_count = 0;
int b_count = 0;
s = s.toLowerCase();
for(int i = 0; i < s.length(); i++){
if(s.charAt(i) == 'p'){
a_count++;
}else if(s.charAt(i) == 'y'){
b_count++;
}
}
if(a_count == b_count){
return true;
}else{
return false;
}
}
}
toLowerCase() 를 이용해 모두 소문자로 만들고 개수를 확인해주면 쉽게 풀 수 있는 문제였다