[알고리즘] 프로그래머스 1단계 - 문자열 내 p와 y의 개수

minidoo·2020년 10월 4일
0

알고리즘

목록 보기
38/85
post-thumbnail
def solution(s):
    
    p_count = s.count('p') + s.count('P')
    y_count = s.count('y') + s.count('Y')
    
    return True if p_count == y_count else False

0개의 댓글