Skip to content

[Chaewon-Park-STUDY] WEEK 04 Solutions - #2966

Open
Chaewon-Park-STUDY wants to merge 15 commits into
DaleStudy:mainfrom
Chaewon-Park-STUDY:week4
Open

Chaewon-Park-STUDY wants to merge 15 commits into
DaleStudy:mainfrom
Chaewon-Park-STUDY:week4

Conversation

@Chaewon-Park-STUDY

@Chaewon-Park-STUDY Chaewon-Park-STUDY commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

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

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

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

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

Important

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

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

@dalestudy

dalestudy Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

๐Ÿค– AI ๋ฆฌ๋ทฐ(์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด, ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„, ํ•™์Šต ํ˜„ํ™ฉ) ๊ฒฐ๊ณผ๋Š” Checks ํƒญ์—์„œ ๋ณผ ์ˆ˜ ์žˆ์–ด์š”.



# ํ’€์ด1) (๋‹ค๋ฅธ ํ’€์ด ๋” ๊ณ ๋ฏผ ์˜ˆ์ •)
#Time:O(n+m),Space:O(n+m) n:list1์˜ ๋…ธ๋“œ์˜ ๊ฐœ์ˆ˜ m:list2์˜ ๋…ธ๋“œ ๊ฐฏ์ˆ˜

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.

๋‘ ๋ฆฌ์ŠคํŠธ๊ฐ€ ์ด๋ฏธ ์ •๋ ฌ๋˜์–ด ์žˆ๋‹ค๋Š” ์ ์„ ํ™œ์šฉํ•ด head๋ผ๋ฆฌ ๋น„๊ตํ•˜๊ณ , ์ž‘์€ ๊ฐ’๋ถ€ํ„ฐ ๋ณ‘ํ•ฉํ•˜๋Š” ์•„์ด๋””์–ด๊ฐ€ ์ข‹์•˜์Šต๋‹ˆ๋‹ค. ์‹œ๊ฐ„ ๋ฐ ๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„๋„ ๋งž๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋˜ํ•œ, ์ด ๋ถ€๋ถ„ ์—ญ์‹œ Space Optimisation์—์„œ์˜ ํฐ ์›๋ฆฌ์™€๋„ ์–ด๋А ์ •๋„ ๋งž์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ๋Š” answer ๋ฐฐ์—ด์— ๋ชจ๋“  ๋…ธ๋“œ์˜ ๊ฐ’์„ ์ €์žฅํ•œ ๋’ค, ์ƒˆ๋กœ์šด ListNode๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์žˆ๋Š”๋ฐ์š”.
ํ˜น์‹œ ๋ณ„๋„์˜ ๋ฐฐ์—ด์— ๊ฐ’์„ ์ €์žฅํ•˜์ง€ ์•Š๊ณ , ๋น„๊ตํ•˜๋Š” ์‹œ์ ์— ๊ธฐ์กด ListNode์˜ next ์ฐธ์กฐ๋ฅผ ์ง์ ‘ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์„๊นŒ์š”?
๊ธฐ์กด ๋ณ‘ํ•ฉ ์•„์ด๋””์–ด๋ฅผ ๊ทธ๋Œ€๋กœ ์œ ์ง€ํ•˜๋ฉด์„œ๋„ ์ถ”๊ฐ€ ๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ O(1)๊นŒ์ง€ ์ค„์ผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ๐Ÿ™‚
์ €๋„ ๋‹ค๋ฅธ ํšจ์œจ์  ํ’€์ด๊ฐ€ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„ ๊ณ ๋ฏผํ•ด๋ณด๋ ค๊ณ  ํ•˜์˜€๋Š”๋ฐ, ๋ง์”€ํ•ด ์ฃผ์‹  ๊ฒƒ์ฒ˜๋Ÿผ ๊ฐ’์„ ๋”ฐ๋กœ ์ €์žฅํ•˜์ง€ ์•Š๊ณ  ๋น„๊ตํ•˜๋Š” ์‹œ์ ์— ๊ธฐ์กด ๋…ธ๋“œ์˜ next๋ฅผ ์ง์ ‘ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ํ’€์–ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค:)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ํ™•์‹คํžˆ ๋…ธ๋“œ ๊ฐ„ ์—ฐ๊ฒฐ๋กœ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜๋‹ˆ ๊ต‰์žฅํžˆ ๊ฐ„๊ฒฐํ•ด์ง€๋„ค์š”~!

@parkhojeong parkhojeong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค! ๋ช‡๊ฐ€์ง€ ์ปค๋ฉ˜ํŠธ ๋‚จ๊ฒผ์Šต๋‹ˆ๋‹ค~

Comment thread word-search/Chaewon-Park-STUDY.py Resolved
Comment thread word-search/Chaewon-Park-STUDY.py Resolved
Comment thread word-search/Chaewon-Park-STUDY.py Outdated
for k in range(4):
nx, ny = x + dxs[k], y + dys[k]
if in_range(nx, ny) and (nx, ny) not in path and board[nx][ny] == word[index + 1]:
stack.append((nx, ny, index + 1, path | {(nx, ny)})) # ๊ฐˆ๋ฆผ๊ธธ๋งˆ๋‹ค ์ƒˆ ์ง‘ํ•ฉ

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ํ˜„์žฌ๋Š” ์ƒˆ๋กœ์šด ๊ฒฝ๋กœ๋ฅผ ํƒ์ƒ‰ํ•  ๋•Œ๋งˆ๋‹ค ์ง‘ํ•ฉ์„ ๋ณต์‚ฌํ•˜๊ณ  ์žˆ์–ด ์ถ”๊ฐ€์ ์ธ ์‹œ๊ฐ„ ๋ฐ ๊ณต๊ฐ„ ๋น„์šฉ์ด ๋ฐœ์ƒํ•˜๋Š”๋ฐ์š”. ์ด ๋ถ€๋ถ„์„ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ๊ณ ๋ฏผํ•ด ๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

๋‹ค๋ฅธ ๋ถ„ ํ’€์ด์—์„œ ๋น„์Šทํ•˜๊ฒŒ ๋ณธ ๊ฒƒ ๊ฐ™์€๋ฐ ์ข€ ๋” ๊ณ ๋ฏผํ•ด๋ณด๊ณ  ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ใ…Žใ…Ž
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

Comment thread coin-change/Chaewon-Park-STUDY.py Resolved
last.next = list2 # list2 ์—ฐ๊ฒฐ
list2 = list2.next
last = last.next # ๊ฒฐ๊ณผ์˜ ๋งˆ์ง€๋ง‰ ๋…ธ๋“œ๋กœ ์ด๋™
last.next = list1 or list2 # ๋‚จ์€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํ†ต์งธ๋กœ ์—ฐ๊ฒฐ

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.

์‚ผํ•ญ์—ฐ์‚ฐ์ž๋ณด๋‹ค list1 or list2 ๋กœ ํ•˜๋ฉด ๋” ๊ฐ„๊ฒฐํ•˜๋„ค์š”. ์ฐธ๊ณ ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

์ €๋„ None ๋‹ค๋ฃจ๋Š” ๊ฒŒ ์•„์ง ์™„์ „ ์ต์ˆ™ํ•˜์ง€๋Š” ์•Š์€๋ฐ, ์š”์ฆ˜ ์ตœ๋Œ€ํ•œ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์จ๋ณด๋ ค๊ณ  ์ด๋ ‡๊ฒŒ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค!

@@ -0,0 +1,15 @@
# ํ’€์ด1) 1์ฐจ์› DP: dp[i] = i์›์„ ๋งŒ๋“œ๋Š” ์ตœ์†Œ ๋™์ „ ์ˆ˜
# ์‹œ๊ฐ„ ๋ณต์žก๋„: O(๊ธˆ์•ก ร— ๋™์ „ ์ข…๋ฅ˜ ์ˆ˜), ๊ณต๊ฐ„ ๋ณต์žก๋„: O(๊ธˆ์•ก)
class Solution:

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.

์ €๋Š” float('inf')๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค๋งŒ 10**10 ์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•œ ๋ถ€๋ถ„์ด ์ธ์ƒ์ ์ด๋„ค์š”.
์ฐพ์•„๋ณด๋‹ˆ ๋ชจ๋“  ๊ฐ€๋Šฅํ•œ ๋™์ „ ๊ฐœ์ˆ˜ ๋ณด๋‹ค ํ•ญ์ƒ ํฐ ๊ฐ€์žฅ ์ž‘์€ ๋Œ€์ฒด๊ฐ’์œผ๋กœ amount + 1๋กœ ์ดˆ๊ธฐํ™”๋ฅผ ํ•ด๋„ ์ข‹์„ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋•๋ถ„์— ํ•™์Šต๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

์ €๋Š” ์˜คํžˆ๋ ค float('inf')๊ฐ€ ๋” ๋ช…์‹œ์ ์ธ ๊ฒƒ ๊ฐ™๋„ค์š”. 10**10์€ ๋งค๋ฒˆ ์ง์ ‘ ์ž…๋ ฅํ•˜๊ธฐ๋„ ๋ฒˆ๊ฑฐ๋กญ๊ณ , ํ˜น์‹œ ๋ฌธ์ œ ์กฐ๊ฑด์—์„œ ์ œํ•œ ๋ฒ”์œ„์— ๋“ค์–ด๊ฐ€๋ฉด ํ‹€๋ฆด ์ˆ˜๋„ ์žˆ์–ด์„œ inf๋กœ ๋‘๋Š” ๊ฒŒ ๋” ์•ˆ์ „ํ•  ๊ฒƒ ๊ฐ™๋„ค์š”.
amount + 1๋กœ ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์ €๋„ ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค:) ๋ฆฌ๋ทฐ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

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.

4 participants