-
-
Notifications
You must be signed in to change notification settings - Fork 195
[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
[sukyoungshin] WEEK 05 #1408
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.
전역적으로 가장 주식 가격이 가장 낮았던 가격을 유지하면서 n번째 날짜와의 거래가 비교로 가장 큰 수익을 찾는 방법이군요!
직관적으로 읽혀서 좋은것 같아요
(저는 카데인 알고리즘으로 끙끙 앓으면서 풀었던 기억이 나는데,, 배워갑니다!🙏🙏)
const left = str.slice(0, i); | ||
const right = str.slice(i); | ||
|
||
if (wordDict.includes(left) && canSplit(right)) { |
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.
오! 뭔가 DP와 재귀 구조가 섞여있는 알고리즘인 것 같아요!
left
변수에 문자를 하나 씩 추가하면서 wordDict 포함되는지 검사하면서, 나머지 문자열에 대해 right
변수에 재귀적으로 넘겨서 확인하는 것 같은데
제가 제대로 이해한게 맞을까요?
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.
네 맞아요! left 쪽 문자열을 앞에서부터 하나씩 늘려가면서 wordDict에 포함되는지 확인하고,
나머지 문자열(right)은 재귀적으로 확인하는 구조예요.
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!