Skip to content

[river20s] WEEK 05 solutions#1391

Merged
river20s merged 10 commits intoDaleStudy:mainfrom
river20s:main
May 3, 2025
Merged

[river20s] WEEK 05 solutions#1391
river20s merged 10 commits intoDaleStudy:mainfrom
river20s:main

Conversation

@river20s
Copy link
Contributor

@river20s river20s commented Apr 28, 2025

๋‹ต์•ˆ ์ œ์ถœ ๋ฌธ์ œ

์ž‘์„ฑ์ž ์ฒดํฌ ๋ฆฌ์ŠคํŠธ

  • ์šฐ์ธก ๋ฉ”๋‰ด์—์„œ PR์„ Projects์— ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
  • Projects์˜ ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ(โ–ผ)์„ ๋ˆŒ๋Ÿฌ ํ™•์žฅํ•œ ๋’ค, Week๋ฅผ ํ˜„์žฌ ์ฃผ์ฐจ๋กœ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
  • ๋ฌธ์ œ๋ฅผ ๋ชจ๋‘ ํ‘ธ์‹œ๋ฉด ํ”„๋กœ์ ํŠธ์—์„œ Status๋ฅผ In Review๋กœ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
  • ์ฝ”๋“œ ๊ฒ€ํ† ์ž 1๋ถ„ ์ด์ƒ์œผ๋กœ๋ถ€ํ„ฐ ์Šน์ธ์„ ๋ฐ›์œผ์…จ๋‹ค๋ฉด PR์„ ๋ณ‘ํ•ฉํ•ด์ฃผ์„ธ์š”.

๊ฒ€ํ† ์ž ์ฒดํฌ ๋ฆฌ์ŠคํŠธ

Important

๋ณธ์ธ ๋‹ต์•ˆ ์ œ์ถœ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋‹ค๋ฅธ ๋ถ„ PR ํ•˜๋‚˜ ์ด์ƒ์„ ๋ฐ˜๋“œ์‹œ ๊ฒ€ํ† ๋ฅผ ํ•ด์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค!

  • ๋ฐ”๋กœ ์ด์ „์— ์˜ฌ๋ผ์˜จ PR์— ๋ณธ์ธ์„ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์–ด๋กœ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
  • ๋ณธ์ธ์ด ๊ฒ€ํ† ํ•ด์•ผํ•˜๋Š” PR์˜ ๋‹ต์•ˆ ์ฝ”๋“œ์— ํ”ผ๋“œ๋ฐฑ์„ ์ฃผ์„ธ์š”.
  • ํ† ์š”์ผ ์ „๊นŒ์ง€ PR์„ ๋ณ‘ํ•ฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์Šน์ธํ•ด์ฃผ์„ธ์š”.

@clara-shin clara-shin self-requested a review April 28, 2025 14:38
# ์ตœ๋Œ€ ์ด์ต ๊ฐฑ์‹ 
max_profit = max(max_profit, (price - min_price))
# ์ตœ์†Œ ๊ฐ€๊ฒฉ ๊ฐฑ์‹ 
min_price = min(min_price, price)
Copy link
Contributor

Choose a reason for hiding this comment

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

"์ตœ์†Œ ์ด์ต ๊ฐฑ์‹  ์ดํ›„ ์ตœ์†Œ ๊ฐ€๊ฒฉ ๊ฐฑ์‹ ํ•ด์•ผ ํ•จ" ์ฃผ์„์ด ์‹ค์ œ ์ฝ”๋“œ ์ˆœ์„œ์™€ ๋ฐ˜๋Œ€๋กœ ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
์ฝ”๋“œ์—์„œ๋Š” ์ตœ๋Œ€ ์ด์ต์„ ๋จผ์ € ๊ณ„์‚ฐํ•œ ํ›„ ์ตœ์†Œ ๊ฐ€๊ฒฉ์„ ๊ฐฑ์‹ ํ•˜๊ณ  ์žˆ์œผ๋ฏ€๋กœ, ์ฃผ์„๊ณผ ๋งž๊ฒŒ ์กฐ์ •ํ•˜๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค :)
์ „๋ฐ˜์ ์œผ๋กœ ๋งค์šฐ ๊น”๋”ํ•˜๊ณ  ํšจ์œจ์ ์ธ ์ฝ”๋“œ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค๐Ÿ‘

Copy link
Contributor Author

Choose a reason for hiding this comment

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

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋ฐ˜์˜ํ•˜์—ฌ์„œ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!

river20s added 5 commits May 1, 2025 23:59
๋ฆฌ๋ทฐ๋ฅผ ๋ฐ˜์˜ํ•˜์—ฌ, ์ตœ๋Œ€ ์ด์ต(max_profit) ๊ณ„์‚ฐ๊ณผ ์ตœ์†Œ ๊ฐ€๊ฒฉ(min_price) ๊ฐฑ์‹  ์ˆœ์„œ๋ฅผ ์„ค๋ช…ํ•˜๋Š” ์ฃผ์„์ด ์‹ค์ œ ์ฝ”๋“œ์™€ ๋ฐ˜๋Œ€๋กœ ๋˜์–ด ์žˆ๋˜ ์˜ค๋ฅ˜๋ฅผ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
์ฝ”๋“œ์—์„œ ์‚ฌ์šฉํ•œ ๋ณ€์ˆ˜๋ช…์„ ์ฃผ์„์— ํ•จ๊ป˜ ํ‘œ๊ธฐํ•ด ๋” ์‰ฝ๊ฒŒ ์ฝํžˆ๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค.
- <139. Word Break> ๋ฌธ์ œ์— ๋Œ€ํ•œ ์ดˆ๊ธฐ ์ ‘๊ทผ ๋ฐฉ์‹์œผ๋กœ ์žฌ๊ท€ ํ˜ธ์ถœ๊ณผ ํŠธ๋ผ์ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„ํ•จ
- ํŠธ๋ผ์ด๋ฅผ ํ†ตํ•ด ๋”•์…”๋„ˆ๋ฆฌ ๋‹จ์–ด ๊ฒ€์ƒ‰ ํšจ์œจ์€ ๊ฐœ์„ ํ–ˆ์œผ๋‚˜ ์žฌ๊ท€ ํ˜ธ์ถœ ๊ณผ์ •์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์ค‘๋ณต ์—ฐ์‚ฐ ๋ฌธ์ œ๋กœ ์ธํ•ด TLE ๋ฐœ์ƒ์„ ํ™•์ธํ•˜์˜€์Œ
- ๋ฉ”๋ชจ์ด์ œ์ด์…˜ ๋˜๋Š” DP๋กœ ์ตœ์ ํ™” ์˜ˆ์ •์ž„
- ๋ฌธ์ œ ์ด์Šˆ: DaleStudy#271
- ๊ธฐ์กด ์žฌ๊ท€ + ํŠธ๋ผ์ด ๋ฐฉ์‹์—์„œ ๋ฐœ์ƒํ•˜๋˜ TLE ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋ฉ”๋ชจ์ด์ œ์ด์…˜์„ ์‚ฌ์šฉํ•˜์˜€์Œ
- `canBreak(start_index)` ํ•จ์ˆ˜ ๊ฒฐ๊ณผ๋ฅผ `memo` ๋”•์…”๋„ˆ๋ฆฌ์— ์บ์‹ฑํ•˜์—ฌ ๋™์ผํ•œ `start_index`์— ๋Œ€ํ•œ ์ค‘๋ณต ๊ณ„์‚ฐ ๋ฐฉ์ง€
@river20s river20s merged commit 92e54ef into DaleStudy:main May 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants