Conversation
doitchuu
approved these changes
Apr 1, 2026
Member
doitchuu
left a comment
There was a problem hiding this comment.
고생하셨습니다 👍
코드가 간단해서 보기 쉬웠던 것 같아요
| if (checkChar(strs, char, i)) { | ||
| answer += char; | ||
| } else { | ||
| break; |
Member
There was a problem hiding this comment.
break말고 바로 answer를 반환해줘도 좋을 것 같아요.
checkChar로 따로 빼니 조건문 확인을 따로 안해도 되서 좋았어요!
sik9252
approved these changes
Apr 2, 2026
| * @return {string} | ||
| */ | ||
| var longestCommonPrefix = function (strs) { | ||
| const checkChar = (strs, c, index) => { |
| */ | ||
| var longestCommonPrefix = function (strs) { | ||
| const checkChar = (strs, c, index) => { | ||
| return strs.every((str) => str[index] === c); |
Collaborator
There was a problem hiding this comment.
공통 접두사 여부도 every로 표현해서 의도가 잘 드러난 것 같아요! 👍
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. Single Number
1) 복잡도 계산
2) 접근 아이디어
3) 회고
2. Longest Common Prefix
1) 복잡도 계산
2) 접근 아이디어
3) 회고