Skip to content

[박종훈] 6주차 답안 제출 #115

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 1 commit into from
Jun 7, 2024
Merged

Conversation

@dev-jonghoonpark dev-jonghoonpark marked this pull request as ready for review June 3, 2024 14:46
Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

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

오 빠르시군요.. 고생많으셨습니다!

@dev-jonghoonpark
Copy link
Contributor Author

오 빠르시군요.. 고생많으셨습니다!

빠르게 풀고 다른 분들 코드 리뷰 같이 하려고요...! ㅎㅎ

Copy link
Member

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

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

종훈님, 답안 제출 1등을 탈환하셨군요! 🎉

Comment on lines +9 to +11
if (s.isEmpty()) {
return 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

이런 류의 체크는 큰 의미없이 코드의 길이만 늘릴 수 있지 않을까요? 얼마큼의 연산량이 아껴지는지 생각해보시면 좋을 것 같습니다. 특히 자바 같이 코드가 긴 편에 속하는 언어에서는 오히려 득보다 해가 될 수 있다고 생각합니다.

Comment on lines +17 to +25
while (pointer < s.length()) {
char _char = s.charAt(pointer);
while (set.contains(_char)) {
set.remove(s.charAt(pointer - set.size()));
}
set.add(_char);
longest = Math.max(longest, set.size());
pointer++;
}
Copy link
Member

Choose a reason for hiding this comment

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

오, 집합을 요렇게 활용하시다니 상당히 신선한데요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

중복이 되면 안된다는 조건이 있어서 Set을 사용해보았습니다 : )

@DaleSeo DaleSeo merged commit 4175013 into DaleStudy:main Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants