-
Notifications
You must be signed in to change notification settings - Fork 120
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
[EGON] Week7 Solutions #496
Conversation
while left < len(s) and right < len(s): | ||
while right < len(s) and s[right] not in checker: | ||
checker.add(s[right]) | ||
right += 1 | ||
|
||
max_length = max(max_length, len(checker)) | ||
|
||
while left < len(s) and (right < len(s) and s[right] in checker): | ||
checker.remove(s[left]) | ||
left += 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.
오, while 문 안에 두 개의 while 문이 대칭을 이루니 뭔가 코드가 아름답게 느껴지네요! 😆
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.
pseudo code스러운 파이썬의 장점 덕분인 것 같습니다. 감사합니다.
def reverse(prev: Optional[ListNode], curr: Optional[ListNode]) -> Optional[ListNode]: | ||
if not curr: | ||
return prev | ||
|
||
post = curr.next | ||
curr.next = prev | ||
return reverse(curr, post) | ||
|
||
return reverse(None, head) |
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.
두 개의 인자를 받는 재귀 구현 배워갑니다 🙇
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.
Dale님 덕분에 즐겁게 문제 풀고 있습니다. 늘 감사드립니다.
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.
수고하셨습니다!
self.post = None | ||
|
||
|
||
class Deque(Generic[T]): |
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.
Deque을 직접 구현까지 하시고 무료하셨나 봅니다 ㅋ
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.
기회있을 때마다 자료구조 구현하기...
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.