uploaded at 2022. 12. 9. 오후 5:40:34
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/12916
|
||||||
|
|
||||||
|
class Solution {
|
||||||
|
boolean solution(String s) {
|
||||||
|
int count = 0;
|
||||||
|
for (char c : s.toLowerCase().toCharArray()){
|
||||||
|
if(c == 'p') count += 1;
|
||||||
|
else if(c == 'y') count -= 1;
|
||||||
|
}
|
||||||
|
return count == 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user