[Jeehay28] Week 08 Solutions#1493
Merged
Jeehay28 merged 6 commits intoDaleStudy:mainfrom May 24, 2025
Merged
Conversation
clara-shin
reviewed
May 22, 2025
| // Shrink the sliding window by moving the left pointer to the right. | ||
| // As we move left, decrease the frequency count of the character being excluded from the window. | ||
| const ch = s[left]; | ||
| freqMap.set(ch, freqMap.get(ch)! - 1); |
Contributor
There was a problem hiding this comment.
Map에서 값을 가져올 때 항상 존재한다고 가정하는 ! 보다, 옵셔널 체이닝 + nullish coalescing 사용이 안전할 것 같아요 :)
Contributor
Author
There was a problem hiding this comment.
아, 그렇군요. 알려주셔서 감사합니다.
clara-shin
reviewed
May 22, 2025
| let scale: number = 1; | ||
|
|
||
| while (stack.length > 0) { | ||
| output += stack.pop()! * scale; |
Contributor
There was a problem hiding this comment.
! 사용보다는 stack.pop() || 0이나, 길이 체크 후 사용이 더 안전할 것 같아요 :)
Contributor
Author
There was a problem hiding this comment.
네, 설명 감사합니다! 타입스크립트가 정적 타입 체크 기반이라는 걸 잘 몰랐을 때는, 런타임에선 항상 안전하다고 생각해서 !만 써서 넘겼던 것 같아요. 이제는 좀 더 안전하게 처리해보겠습니다. 😊
| 3. If you need the result as a 32-bit unsigned integer (like for LeetCode problems dealing with uint32): | ||
| - Use >>> 0 at the end of your result | ||
| - This forces the result to be treated as an unsigned 32-bit integer | ||
| */ |
Contributor
There was a problem hiding this comment.
자바스크립트의 비트 연산 특성과 32비트 정수 변환 과정을 자세히 설명한 점이 좋았어요! 👍
clara-shin
approved these changes
May 23, 2025
Contributor
clara-shin
left a comment
There was a problem hiding this comment.
이번 한주도 고생 많으셨어요! 다음주도 화이팅입니다 👍👍
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 하나 이상을 반드시 검토를 해주셔야 합니다!