Skip to content

[sukyoungshin] WEEK 05 #1408

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 4 commits into from
May 3, 2025
Merged

[sukyoungshin] WEEK 05 #1408

merged 4 commits into from
May 3, 2025

Conversation

sukyoungshin
Copy link
Contributor

@sukyoungshin sukyoungshin commented May 2, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

Copy link
Contributor

@YoungSeok-Choi YoungSeok-Choi left a comment

Choose a reason for hiding this comment

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

수고 많으셨습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

전역적으로 가장 주식 가격이 가장 낮았던 가격을 유지하면서 n번째 날짜와의 거래가 비교로 가장 큰 수익을 찾는 방법이군요!

직관적으로 읽혀서 좋은것 같아요
(저는 카데인 알고리즘으로 끙끙 앓으면서 풀었던 기억이 나는데,, 배워갑니다!🙏🙏)

const left = str.slice(0, i);
const right = str.slice(i);

if (wordDict.includes(left) && canSplit(right)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

오! 뭔가 DP와 재귀 구조가 섞여있는 알고리즘인 것 같아요!

left 변수에 문자를 하나 씩 추가하면서 wordDict 포함되는지 검사하면서, 나머지 문자열에 대해 right 변수에 재귀적으로 넘겨서 확인하는 것 같은데

제가 제대로 이해한게 맞을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 맞아요! left 쪽 문자열을 앞에서부터 하나씩 늘려가면서 wordDict에 포함되는지 확인하고,
나머지 문자열(right)은 재귀적으로 확인하는 구조예요.

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

2 participants