[mingxoxo] programmers_체육복_Python - #35
Open
mingxoxo wants to merge 1 commit into
Open
Conversation
mingxoxo
requested review from
jaejunmin408,
just-stopyoon,
sangkyu39 and
seungbinpark
February 16, 2025 09:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/42862
💡 풀이 아이디어
먼저 체육복을 도난당한 학생에 대한 정보를
lost_student리스트에 반영해주었습니다.그리고 이후 체육복 여벌을 가지고 온 학생들의 정보를 바탕으로 빌려줄 수 있는 학생 수를 계산해주었습니다.
처음에는 그냥 도난당한 학생 모두를 기록하고 본인이 잃어버렸을 경우를 추후에 확인했는데, 이렇게 했을 때 아래 조건이 제대로 만족되지 못하는 경우가 발생해서 먼저 처리해주었습니다.
따라서
set을 활용하여 여벌 체육복을 가져온 학생이 체육복을 도난 당한 경우를 제외하고 검사하였습니다. 나중에 빌려줄 때도 마찬가지로 본인이 입을 경우를 제외하고 빌려줄 수 있는 경우만을 확인했습니다.📝 새로 학습한 내용
📚 참고 자료