Skip to content

[soobing] WEEK09 Solutions #1525

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 5 commits into from
Jun 2, 2025
Merged

[soobing] WEEK09 Solutions #1525

merged 5 commits into from
Jun 2, 2025

Conversation

soobing
Copy link
Contributor

@soobing soobing commented May 26, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@soobing soobing moved this from Solving to In Review in 리트코드 스터디 4기 May 29, 2025
Copy link
Contributor

@clara-shin clara-shin left a comment

Choose a reason for hiding this comment

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

이번 주도 고생 많으셨습니다! 다음주도 화이팅이에요!!

* - 매 index마다, 현재까지 max 곱, min 곱을 찾고 최대값을 갱신
*/
function maxProduct(nums: number[]): number {
let maxSoFar = nums[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

모든 경우를 한 번에 고려하는 깔끔한 접근입니다 👍
초기에 빈 배열 예외처리가 있으면 더 좋을것 같아요!

* - 비가 내렸을 때, 태평양과 대서양 모두로 물이 흐를 수 있는 지점을 찾아 반환하는 문제입니다.
* 아이디어
* 1) BFS/DFS
* - 각 바다에서 역방향으로 물이 도달할 수 있는 셀을 탐색한 후, 두 바다 모두에 도달 가능한 셀의 교집합 구하기
Copy link
Contributor

@YoungSeok-Choi YoungSeok-Choi May 31, 2025

Choose a reason for hiding this comment

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

안녕하세요!
요 문제를 반대로 바다에서 부터 시작하는 방식으로 접근해 풀이해 보셨군요...!

저는 모든 셀에 대해서 양 바다로 모두 닿을 수 있는지 여부를 판단하려고 모든 셀 * 2 번씩 dfs 를 돌렸었는데
이런 아이디어를 떠올리게 된 뭐랄까요 생각의 과정..? 를 간단히 설명해주실 수 있을까요!?

(어떤 부분을 보고 이렇게 접근해볼 수도 있겠다.. 라는 식의 느낌입니다 🤣 뭔가 콕찝어서 설명을 못하겠네요ㅠ)

+) 알고리즘 문제를 풀이하실 때 풀이 아이디어를 떠올리시는 포인트? 같은것도 만약 있으시다면 알려주시면 감사히 배워가겠습니다!

@SamTheKorean SamTheKorean merged commit 3f22d42 into DaleStudy:main Jun 2, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Jun 2, 2025
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.

4 participants