Skip to content
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

Merged
merged 5 commits into from
Jan 25, 2025
Merged

[Helena] Week 7 #936

merged 5 commits into from
Jan 25, 2025

Conversation

yolophg
Copy link
Contributor

@yolophg yolophg commented Jan 21, 2025

답안 제출 문제

체크 리스트

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

@yolophg yolophg requested a review from dusunax January 21, 2025 07:18
@yolophg yolophg requested a review from a team as a code owner January 21, 2025 07:18
@github-actions github-actions bot added the py label Jan 21, 2025
@DaleSeo
Copy link
Contributor

DaleSeo commented Jan 21, 2025

홧팅! 🐣

Copy link
Member

@dusunax dusunax left a 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()
Copy link
Member

@dusunax dusunax Jan 24, 2025

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-words

Originally posted by @ekgns33 in #935 (comment)

Copy link
Member

@dusunax dusunax left a comment

Choose a reason for hiding this comment

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

고생하셨습니다🙂

@TonyKim9401 TonyKim9401 merged commit eb43e21 into DaleStudy:main Jan 25, 2025
1 check passed
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.

5 participants