Skip to content

Conversation

@doyoungkim-code
Copy link
Contributor

  1. dp[i]에 i일 종료 상담의 최대 수익, maxProfit에 현재까지의 누적 최대 수익을 저장.
  2. 매일(i일), dp[i]와 비교하여 maxProfit을 전체 기간의 최대 수익으로 유지.
  3. i일 상담의 총수익을 'maxProfit + profit'으로 계산, 종료일(nextDay)의 dp 값을 갱신.
  4. 최종 maxProfit과 dp[N] 중 더 큰 값을 정답으로 출력.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants