Skip to content

[daehyun99] WEEK 05 Solutions#2764

Open
daehyun99 wants to merge 2 commits into
DaleStudy:mainfrom
daehyun99:W5
Open

[daehyun99] WEEK 05 Solutions#2764
daehyun99 wants to merge 2 commits into
DaleStudy:mainfrom
daehyun99:W5

Conversation

@daehyun99

@daehyun99 daehyun99 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

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

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

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

Important

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

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

@dalestudy

dalestudy Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

๐Ÿ“Š daehyun99 ๋‹˜์˜ ํ•™์Šต ํ˜„ํ™ฉ

์ด๋ฒˆ ์ฃผ ์ œ์ถœ ๋ฌธ์ œ

๋ฌธ์ œ ๋‚œ์ด๋„ ์œ ํ˜• ๋ถ„์„
best-time-to-buy-and-sell-stock Easy โœ… ์˜๋„ํ•œ ์œ ํ˜•
group-anagrams Medium โœ… ์˜๋„ํ•œ ์œ ํ˜•

๋ˆ„์  ํ•™์Šต ์š”์•ฝ

  • ํ’€์ดํ•œ ๋ฌธ์ œ: 19 / 75๊ฐœ
  • ์ด๋ฒˆ ์ฃผ ์œ ํ˜• ์ผ์น˜์œจ: 100% (2๋ฌธ์ œ ์ค‘ 2๋ฌธ์ œ ์ผ์น˜)

๋ฌธ์ œ ํ’€์ด ํ˜„ํ™ฉ

์นดํ…Œ๊ณ ๋ฆฌ ์ง„ํ–‰๋„ ์™„๋ฃŒ
Array โ– โ– โ– โ– โ–กโ–กโ–ก 6 / 10 (Medium 4, Easy 2)
Dynamic Programming โ– โ– โ– โ–กโ–กโ–กโ–ก 4 / 11 (Easy 1, Medium 3)
Heap โ– โ– โ–กโ–กโ–กโ–กโ–ก 1 / 3 (Medium 1)
Matrix โ– โ– โ–กโ–กโ–กโ–กโ–ก 1 / 4 (Medium 1)
Binary โ– โ–กโ–กโ–กโ–กโ–กโ–ก 1 / 5 (Easy 1)
String โ– โ–กโ–กโ–กโ–กโ–กโ–ก 2 / 10 (Easy 2)
Linked List โ– โ–กโ–กโ–กโ–กโ–กโ–ก 1 / 6 (Easy 1)
Tree โ– โ–กโ–กโ–กโ–กโ–กโ–ก 2 / 14 (Easy 1, Medium 1)
Graph โ– โ–กโ–กโ–กโ–กโ–กโ–ก 1 / 8 (Medium 1)
Interval โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 5 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ

๐Ÿค– ์ด ๋Œ“๊ธ€์€ GitHub App์„ ํ†ตํ•ด ์ž๋™์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ”ข API ์‚ฌ์šฉ๋Ÿ‰ (gpt-5-nano)
์š”์ฒญ ์ž…๋ ฅ ํ† ํฐ ์ถœ๋ ฅ ํ† ํฐ ํ•ฉ๊ณ„ ๋น„์šฉ
1 305 56 361 $0.000038
2 751 97 848 $0.000076
ํ•ฉ๊ณ„ 1,056 153 1,209 $0.000114

@yuseok89
yuseok89 self-requested a review July 20, 2026 13:55

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

๊ฝค ๊น”๋”ํ•˜๊ฒŒ ์ž˜ ํ•ด๊ฒฐํ•˜์…จ๋„ค์š”!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

๊ทธ๋ฆฌ๊ณ 
best time to buy and sell stock, ์ฆ‰ ํ•ด๋‹น ๋ฌธ์ œ๋Š”
๋’ค์— ๋กœ๋งˆ ์ˆซ์ž๋ฅผ ๋ถ™ํ˜€์„œ 1, 2, 3, 4, 5 ์ด ๋‹ค์„ฏ์ข…๋ฅ˜๊ฐ€ ์žˆ๋Š”๋ฐ์š”
dp ์—ฐ์Šตํ•˜๊ธฐ์— ์ •๋ง ๊ดœ์ฐฎ์€ ๋ฌธ์ œ๋ผ๊ณ  ์ƒ๊ฐํ•ด์„œ
2๋ฒˆ๋ฌธ์ œ
II๋Š” ํ•œ๋ฒˆ ํ’€์–ด๋ณด์‹œ๊ธธ ์ถ”์ฒœ๋“œ๋ ค์š”!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Two Pointers, Greedy
  • ์„ค๋ช…: ๋ฆฌ์ŠคํŠธ๋ฅผ ํ•œ ๋ฐฉํ–ฅ์œผ๋กœ ๋‘ ํฌ์ธํ„ฐ๋ฅผ ์›€์ง์ด๋ฉฐ ํ˜„์žฌ ์ด์ต์„ ๊ณ„์‚ฐํ•˜๊ณ , ๋” ์ž‘์€ ๊ฐ’์„ ์•žํฌ์ธํ„ฐ๋กœ ์ด๋™์‹œํ‚ค๋Š” ๋ฐฉ์‹์œผ๋กœ ์ตœ๋Œ“๊ฐ’์„ ๊ตฌํ•œ๋‹ค. ์„ ํ˜• ํƒ์ƒ‰๊ณผ ๋ถ€๋ถ„ ์ตœ์ ํ™”๋ฅผ ํ†ตํ•ด ๋น ๋ฅด๊ฒŒ ํ•ด๋ฅผ ์ฐพ๋Š” ๊ทธ๋ฆฌ๋”” ํŒจํ„ด์ด๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n)
Space O(1)

ํ”ผ๋“œ๋ฐฑ: ๋‘ ํฌ์ธํ„ฐ(l, r)๊ฐ€ ํ•œ ๋ฒˆ์”ฉ ์ฆ๊ฐ€ํ•˜๋ฉฐ ๊ฐ ๊ฐ€๊ฒฉ์„ ๋‹จ ํ•œ๋ฒˆ์”ฉ๋งŒ ํ™•์ธํ•˜๋ฏ€๋กœ ์„ ํ˜• ์‹œ๊ฐ„๊ณผ ์ƒ์ˆ˜ ๊ณต๊ฐ„์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌํ˜„์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Hash Map / Hash Set, Bit Manipulation
  • ์„ค๋ช…: ๋ฌธ์ž ๋นˆ๋„ ์นด์šดํŠธ๋ฅผ ์ด์šฉํ•ด ์• ๋„ˆ๊ทธ๋žจ์„ ๊ทธ๋ฃนํ•‘ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ, ๊ฐ ๋ฌธ์ž์—ด์˜ ํŠน์„ฑ(๋ฌธ์ž ๋“ฑ์žฅ ํšŸ์ˆ˜)์„ ํ‚ค๋กœ ์‚ฌ์šฉํ•ด ํ•ด์‹œ ๋งต์— ๋ฌถ๋Š”๋‹ค. ๋˜ํ•œ ๋ฌธ์ž ๊ฐœ์ˆ˜๋ฅผ ๋ฐฐ์—ด๋กœ ํ‘œํ˜„ํ•ด ๋น ๋ฅธ ๋น„๊ต๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•œ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

๋ณต์žก๋„
Time O(n * k)
Space O(n * k)

ํ”ผ๋“œ๋ฐฑ: ๊ฐ ๋ฌธ์ž์—ด์— ๋Œ€ํ•ด ๊ธธ์ด k์˜ ๋ฌธ์ž ์นด์šดํŠธ๋ฅผ ๊ณ„์‚ฐํ•˜๊ณ  ์ด๋ฅผ ํ‚ค๋กœ ์‚ฌ์šฉํ•ด ๊ทธ๋ฃน์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. ํ•ด์‹œ๋งต์˜ ํ‚ค๊ฐ€ ๊ณ ์ • ๊ธธ์ด(26์ฐจ์›)์ธ ์ ์ด ํŠน์ง•์ž…๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌํ˜„์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๐Ÿ’ก ํ’€์ด์— ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ฃผ์„์œผ๋กœ ๋‚จ๊ฒจ๋ณด์„ธ์š”!

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

Labels

Development

Successfully merging this pull request may close these issues.

2 participants