-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Helena] Week 7 #936
[Helena] Week 7 #936
Conversation
홧팅! 🐣 |
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.
안녕하세요! 저도 Python으로 풀고 있습니다.
리트코드 스터디에서 같은 언어로 푸시는 분과 처음 짝이 되었네요:D
class Solution: | ||
def lengthOfLongestSubstring(self, s: str) -> int: | ||
# to store characters in the current window | ||
window_set = set() |
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.
고생하셨습니다!
Set 자료구조를 사용하면 worst case시 공간 복잡도가 O(n)이 되는데
ASCII 배열을 사용해서 O(1)으로 개선하는 방향에 대해서 @ekgns33님께 리뷰를 받아서 함께 공유 드립니다🙂
부분문자열에서 각 문자는 1회만 등장할 수 있다는 조건때문에 Set을 선택하셨군요. 👍
문자의 범위가 명확하게 정의되어 있다면 (e.g ASCII) 배열을 사용할 수도 있을 것 같아요!아래 문제도 추가적으로 풀어보시면 sliding window 패턴을 익히시는데 도움이 될 것 같습니다
https://leetcode.com/problems/substring-with-concatenation-of-all-wordsOriginally posted by @ekgns33 in #935 (comment)
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
로 설정해주세요.