-
-
Notifications
You must be signed in to change notification settings - Fork 195
[박종훈] 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
[박종훈] 6주차 답안 제출 #115
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.
오 빠르시군요.. 고생많으셨습니다!
빠르게 풀고 다른 분들 코드 리뷰 같이 하려고요...! ㅎㅎ |
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.
종훈님, 답안 제출 1등을 탈환하셨군요! 🎉
if (s.isEmpty()) { | ||
return 0; | ||
} |
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 (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++; | ||
} |
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.
중복이 되면 안된다는 조건이 있어서 Set을 사용해보았습니다 : )
Container With Most Water
문제: https://leetcode.com/problems/container-with-most-water/
풀이: https://algorithm.jonghoonpark.com/2024/06/02/leetcode-11
Longest Substring Without Repeating Characters
문제: https://leetcode.com/problems/longest-substring-without-repeating-characters/
풀이: https://algorithm.jonghoonpark.com/2024/02/18/leetcode-3
Longest Repeating Character Replacement
문제: https://leetcode.com/problems/longest-repeating-character-replacement/
풀이: https://algorithm.jonghoonpark.com/2024/04/29/leetcode-424
Find Minimum In Rotated Sorted Array
문제: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
풀이: https://algorithm.jonghoonpark.com/2024/06/03/leetcode-153
Search In Rotated Sorted Array
문제: https://leetcode.com/problems/search-in-rotated-sorted-array/
풀이: https://algorithm.jonghoonpark.com/2024/06/03/leetcode-33