문제 설명 솔루션 class Solution { boolean solution(String s) { boolean answer = true; s = s.toLowerCase(); int cnt = 0; for(int i = 0; i < s.length(); i++){ if(s.charAt(i) == 'y'){ cnt++; }else if(s.charAt(i) == 'p'){ cnt--; } } if(cnt == 0){ answer = true; }else{ answer = false; } return answer; } }