programmers | Lv1. 문자열 내 p와 y의 개수 [Python]

yeonk·2022년 2월 12일
0

algorithm

목록 보기
17/88
post-thumbnail

💡 Python 3






🔗 문제

문자열 내 p와 y의 개수 [Link]






💻 코드

def solution(s):
    from collections import Counter
    counter = Counter(s.lower())
    return counter['p'] == counter['y'] 

0개의 댓글