Skip to content

[WEEK08-1] 추슬기#36

Merged
doitchuu merged 2 commits into
pnt-fe-study:mainfrom
doitchuu:doitchuu
Apr 3, 2026
Merged

[WEEK08-1] 추슬기#36
doitchuu merged 2 commits into
pnt-fe-study:mainfrom
doitchuu:doitchuu

Conversation

@doitchuu
Copy link
Copy Markdown
Member

@doitchuu doitchuu commented Mar 30, 2026

이렇게 풀었어요

1. Longest Common Prefix

  • 문제를 풀었어요.
  • 풀이 시간 : 18분

1) 복잡도 계산

  • 시간 복잡도: O(n * m)
  • 공간 복잡도: O(m)

2) 접근 아이디어

  1. 첫 번째 문자열을 기준으로 한 글자씩 확인했다.
  2. 같은 위치의 문자가 나머지 문자열에도 모두 같은지 비교했다.
  3. 하나라도 다르면 지금까지 만든 prefix를 반환하고, 끝까지 같으면 prefix 전체를 반환했다.

3) 회고

없음



2. Single Number

  • 문제를 풀었어요.
  • 풀이 시간 : 5분

1) 복잡도 계산

  • 시간 복잡도: O(n)
  • 공간 복잡도: O(n)

2) 접근 아이디어

  1. 숫자별 등장 횟수를 Map에 저장한다.
  2. 다시 Map을 돌면서 값이 1인 숫자를 찾는다.
  3. 그 숫자가 정답이다.

3) 회고

없음



@doitchuu doitchuu requested review from raejun92 and sik9252 March 31, 2026 01:02
@doitchuu doitchuu self-assigned this Mar 31, 2026
Copy link
Copy Markdown
Collaborator

@raejun92 raejun92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회고가 같이 안올라 온 것 같아요!

@doitchuu doitchuu requested a review from raejun92 April 1, 2026 02:05
Copy link
Copy Markdown
Collaborator

@raejun92 raejun92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOOD

Copy link
Copy Markdown
Collaborator

@sik9252 sik9252 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다들 너무 깔끔하게 푸셔서 리뷰할게 보이지 않습니다!!! 오히려 배워가는데 좋네용


for (let j = 1; j < strs.length; j++) {
if (strs[j][i] !== current) {
return prefix;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

바로 반환해서 불필요한 탐색 줄이는 방법👍합니다 ㅎㅎ

@doitchuu doitchuu merged commit f746ad0 into pnt-fe-study:main Apr 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants