[yyyyyyyyyKim] WEEK 09 solutions#1520
Merged
yyyyyyyyyKim merged 6 commits intoDaleStudy:mainfrom May 31, 2025
Merged
Conversation
Jeehay28
approved these changes
May 30, 2025
Contributor
Jeehay28
left a comment
There was a problem hiding this comment.
한 주 동안 문제 풀이 하시느라 고생 많으셨습니다. 깔끔하고 간결한 풀이 덕분에 이해하기 쉬웠습니다. 다음 주도 화이팅입니다.
| n = nums[i] | ||
|
|
||
| # 음수*음수는 양수이므로 max,min 둘다 계산 | ||
| curr_max = max(n,prev_max*n, prev_min*n) |
Contributor
There was a problem hiding this comment.
중간 변수 2개(curr_max, curr_min) 사용하니까 훨씬 이해하기가 편하네요. 👍
| # 최소 윈도우 길이 갱신 | ||
| if (right - left + 1) < min_len: | ||
| min_len = right - left + 1 | ||
| answer = s[left:right+1] |
Contributor
There was a problem hiding this comment.
최소 윈도우 길이 갱신할 때, answer에 해당 부분 문자열을 바로 저장해두면 마지막에 그대로 반환할 수 있어 편리하네요! 👍
| class Solution: | ||
| def getSum(self, a: int, b: int) -> int: | ||
|
|
||
| # 비트 연산(보완이 필요함, python은 무제한정수를 사용하므로 mask써서 32bit 정수로 잘라줘야함) |
Contributor
There was a problem hiding this comment.
Python 정수형이 오버플로우 없이 무한정 커질 수 있다는 특징을 알게 되어 좋았습니다.
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.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!