Skip to content

Conversation

Jay-Mo-99
Copy link
Contributor

@Jay-Mo-99 Jay-Mo-99 commented Jan 6, 2025

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@Jay-Mo-99 Jay-Mo-99 requested a review from jungsiroo January 6, 2025 21:20
@Jay-Mo-99 Jay-Mo-99 self-assigned this Jan 6, 2025
@Jay-Mo-99 Jay-Mo-99 requested a review from a team as a code owner January 6, 2025 21:20
@github-actions github-actions bot added the py label Jan 6, 2025
Copy link
Contributor

@jungsiroo jungsiroo left a comment

Choose a reason for hiding this comment

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

상세 설명들을 써두는 점이 좋은 것 같습니다. 시간복잡도와 다양한 테스트 케이스를 고민해보는게 라이브 코딩테스트에서 어렵더라구요,, 이 부분 같이 고민해나가면 좋을 것 같습니다!



def encode(self, strs: List[str]) -> str:
answer = '!@#$%123456789'.join(strs)
Copy link
Contributor

Choose a reason for hiding this comment

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

만약 strs배열의 구성요소가 ['!@#$%123456789', '!@#$%', ''!@#$%123456789123123'] 이라면 encode가 조금은 꼬이지 않을까 합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네, 구분자(!@#$%123456789) 가 strs의 요소로 나온다면 해당 풀이법은 유효하지 않습니다. 가장 안전한 방법은 strs의 각 요소의 길이를 측정하여 decode때 해당 길이를 기반으로 나눠주는 방법이라고 들었습니다.

tempDict = defaultdict(list)

for s in strs:
key = tuple(sorted(s))
Copy link
Contributor

Choose a reason for hiding this comment

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

정렬을 하지 않고 다르게 풀면 시간복잡도를 줄일 수 있을 것 같은데 어떤 방법이 있을까요?

Copy link
Contributor

@TonyKim9401 TonyKim9401 left a comment

Choose a reason for hiding this comment

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

5주차 문제 풀이 고생 많으셨습니다!

@TonyKim9401 TonyKim9401 merged commit 94908a3 into DaleStudy:main Jan 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants