[python] '티셔츠' - 프로그래머스 커뮤러닝 week2

eve·2022년 11월 26일
0

programmers

목록 보기
6/7

def solution(people, tshirts):
    people.sort()
    tshirts.sort()
    p, t, ans = 0, 0, 0
    while p < len(people) and t < len(tshirts):
        if tshirts[t] >= people[p]:
            ans += 1
            p += 1
        t += 1
    return ans
    
profile
유저가 왜 그랬을까

0개의 댓글