-
-
Notifications
You must be signed in to change notification settings - Fork 195
[bky373] Week 6 Solutions #121
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
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.
오
find-minimum-in-rotated-sorted-array 문제를 통해 만든
min 값 찾는 로직을 사용해서 푸셨군요
search-in-rotated-sorted-array/dev-jonghoonpark.md
저는 그냥 아예 새로 작성했는데 논리가 분리되는 면에서는 작성해주신 코드도 재밌네요 ㅎㅎ
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.
@dev-jonghoonpark
오 이렇게 풀 수도 있군요.. 빠르기도 하고 함수도 덜 사용하여 좋은 풀이법 같습니다! 공유해주셔서 감사합니다!
int max = 0; | ||
while (left < right) { | ||
int area = (right - left) * Math.min(height[left], height[right]); | ||
if (area > max) { |
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.
요 부분을
max = Math.max(max, area)
요렇게 고치는걷 괜찮아 보이네요!
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.
코드 깔끔하게 작성해주시는 게 대단하네요! 이번주도 수고하셨습니다 👍
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.
이 문제는 지독히 안 풀리는 문제 중 하나네요.. ㅠㅠ 역시 세상엔 고수가 많은 것 같습니다
Solved Problems