-
Notifications
You must be signed in to change notification settings - Fork 4
[JustDevRae] 25.02.16 #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Moonjonghoo
approved these changes
Feb 17, 2025
Collaborator
Moonjonghoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체적으로 중복제거는 Set 자료구조를 활용하셔서 통일성있게 푸신거같아요!
한주간 고생하셨어요
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.
📌 푼 문제
📝 간단한 풀이 과정
중복된 문자 제거
문자열을 Set으로 변환한 후 배열로 바꿔 다시 문자열로 합치는 방식으로 해결했습니다.
한 번만 등장한 문자
Set을 사용해 문자의 등장 여부를 체크한 후, 중복된 문자는 별도의 Set에 저장하여 제거하는 방식으로 해결했습니다.
무작위로 K개의 수 뽑기
Set을 활용하여 중복된 숫자를 제외하고 저장하고, 필요한 개수 k를 채웁니다. 만약 k개를 채우지 못하면 남은 부분을 -1로 채우는 방식으로 해결했습니다.
Contains Duplicate
Set을 활용하여 배열의 중복을 빠르게 확인하는 방식으로 해결했습니다.
소인수분해
가장 작은 소수 2부터 시작하여 나누어 떨어질 때까지 나누고, 나눈 값을 저장하는 방식으로 해결했습니다. 중복된 소수는 Set을 사용하여 자동으로 제거되도록 처리했습니다.