Skip to content

[krokerdile] WEEK 02 solutions #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 14, 2025
Merged

[krokerdile] WEEK 02 solutions #1225

merged 6 commits into from
Apr 14, 2025

Conversation

krokerdile
Copy link
Contributor

@krokerdile krokerdile commented Apr 7, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@krokerdile krokerdile changed the title valid-anagram solution [krokerdile] WEEK 02 solutions Apr 9, 2025
@DaleSeo
Copy link
Member

DaleSeo commented Apr 10, 2025

@krokerdile 님, 프로젝트 주차 설정 좀 부탁드립니다. 디스코드에 응답이 없으셔서 PR에 코멘트도 남겨드립니다.

@krokerdile
Copy link
Contributor Author

@krokerdile 님, 프로젝트 주차 설정 좀 부탁드립니다. 디스코드에 응답이 없으셔서 PR에 코멘트도 남겨드립니다.

죄송합니다, 방금 확인했네요! 주차별 설정 해뒀습니다. 해둔 줄 알고 깜박했네요😅

@krokerdile krokerdile moved this from Solving to In Review in 리트코드 스터디 4기 Apr 11, 2025
# 오른쪽 서브트리는 최소값을 현재 노드 값으로 제한
return validate(node.left, low, node.val) and validate(node.right, node.val, high)

return validate(root, float('-inf'), float('inf'))
Copy link
Contributor

Choose a reason for hiding this comment

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

저는 자바로 해서 long을 사용했는데 파이썬에서는 float로 하군요!
혹시 파이썬에도 int 보다는 크고 float 보다는 작은 범위가 있나요?
그것이 있다면 그것으로 해도 될 듯 하네요

Comment on lines +9 to +11
for i in range(len(s)):
a[s[i]] = a.get(s[i], 0) + 1
b[t[i]] = b.get(t[i], 0) + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

제가 파이썬을 하지 않아서 이 부분이 잘 이해가 가지 않는데 어떤 순서로 리스트에 넣는 건가요?

else:
right -= 1 # 합이 크면 오른쪽을 왼쪽으로

return result
Copy link
Contributor

Choose a reason for hiding this comment

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

포인터를 사용해서 하셨군요!
여러가지 방법을 배웁니다
저도 이 방법으로 다시 풀어봐야 겠어요
혹시 2가지 방법 중 어떤 것이 속도가 더 빨랐나요?

@krokerdile krokerdile merged commit 9e2eb08 into DaleStudy:main Apr 14, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants