-
-
Notifications
You must be signed in to change notification settings - Fork 230
[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
Conversation
@krokerdile 님, 프로젝트 주차 설정 좀 부탁드립니다. 디스코드에 응답이 없으셔서 PR에 코멘트도 남겨드립니다. |
죄송합니다, 방금 확인했네요! 주차별 설정 해뒀습니다. 해둔 줄 알고 깜박했네요😅 |
# 오른쪽 서브트리는 최소값을 현재 노드 값으로 제한 | ||
return validate(node.left, low, node.val) and validate(node.right, node.val, high) | ||
|
||
return validate(root, float('-inf'), float('inf')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 자바로 해서 long을 사용했는데 파이썬에서는 float로 하군요!
혹시 파이썬에도 int 보다는 크고 float 보다는 작은 범위가 있나요?
그것이 있다면 그것으로 해도 될 듯 하네요
for i in range(len(s)): | ||
a[s[i]] = a.get(s[i], 0) + 1 | ||
b[t[i]] = b.get(t[i], 0) + 1 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
포인터를 사용해서 하셨군요!
여러가지 방법을 배웁니다
저도 이 방법으로 다시 풀어봐야 겠어요
혹시 2가지 방법 중 어떤 것이 속도가 더 빨랐나요?
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!