Conversation
LeeBaeJin
reviewed
Apr 13, 2026
| const len = s.length; | ||
|
|
||
| s = s.replaceAll("0", ""); | ||
|
|
Collaborator
There was a problem hiding this comment.
와 replaceAll은 생각지도 못했네요
LeeBaeJin
reviewed
Apr 13, 2026
|
|
||
| A.sort((a, b) => a - b); | ||
| B.sort((a, b) => b - a); | ||
|
|
Collaborator
There was a problem hiding this comment.
javascript sort함수로 역순을 이렇게 표현할 수 있군요
LeeBaeJin
approved these changes
Apr 13, 2026
Collaborator
LeeBaeJin
left a comment
There was a problem hiding this comment.
좋은 공부가 되었습니다! 수고많으셨습니다!
doitchuu
approved these changes
Apr 14, 2026
| s = oneCount.toString(2); | ||
|
|
||
| zero += len - oneCount; | ||
| count++; |
sik9252
approved these changes
Apr 18, 2026
Collaborator
sik9252
left a comment
There was a problem hiding this comment.
replaceAll을 쓰는 방법도 있군요~! 왜 안 떠올랐지 ㅠ 역시 잘 푸셨네요 고생하셨습니다!
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.
이렇게 풀었어요
1. 이진변환반복하기
1) 복잡도 계산
2) 접근 아이디어
3) 회고
문제에서 요구사항을 그대로 구현하면 되는 문제였다. 문자열 메서드를 오랜만에 사용해서 조금 헷갈렸다.
2. 최솟값만들기
1) 복잡도 계산
2) 접근 아이디어
3) 회고
눈치껏 최솟값과 최댓값을 곱하는 방식으로 풀이했다. 근데 왜 그게 최솟값이 되는지는 잘 모르겠다.