Skip to content

[yerim01] WEEK 01 solutions#2365

Merged
yerim01 merged 2 commits intoDaleStudy:mainfrom
yerim01:main
Mar 7, 2026
Merged

[yerim01] WEEK 01 solutions#2365
yerim01 merged 2 commits intoDaleStudy:mainfrom
yerim01:main

Conversation

@yerim01
Copy link
Copy Markdown
Contributor

@yerim01 yerim01 commented Mar 3, 2026

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

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

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

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

Important

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

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

Copy link
Copy Markdown
Contributor

@hyejj19 hyejj19 left a comment

Choose a reason for hiding this comment

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

๋ฌธ์ œ ํ’€์ด ํ•˜์‹œ๋А๋ผ ๊ณ ์ƒ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค! ๋‹ค์Œ ํ•œ ์ฃผ๋„ ํ™”์ดํŒ…์ž…๋‹ˆ๋‹ค~!!๐Ÿ˜ƒ

Comment on lines +4 to +7
# Approach:
# - Use a hash set to track elements we have already seen.
# - Iterate through the array and if the current number already exists in the set, return True.
# - Otherwise, add the current number to the set.
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.

์˜ค ์„ค๋ช…์ด ์—„์ฒญ ๊ฐ„๊ฒฐํ•˜๋„ค์š”..! ๐Ÿ‘๐Ÿ‘

Comment on lines +29 to +44
for c in nums:
currentL = 1
j = 1

while c+j in s:
s.remove(c+j)
currentL += 1
j += 1

j = 1
while c-j in s:
s.remove(c-j)
currentL += 1
j += 1

longest = max(longest, currentL)
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.

์˜ค! ๊ธฐ์ค€ ์›์†Œ c๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์–‘์ชฝ์„ ์ œ๊ฑฐํ•ด์„œ ์ค‘๋ณต ํƒ์ƒ‰์„ ๋ฐฉ์ง€ํ•˜๋Š” ์˜๋„๊ตฐ์š”!๐Ÿ‘๐Ÿ‘

๊ทผ๋ฐ ๊ธฐ์ค€์ ์ธ c๋Š” set์—์„œ ์ œ๊ฑฐ๋˜์ง€ ์•Š์•„์„œ, ๋‹ค์Œ ๋ฐ˜๋ณต์—์„œ ์ด์›ƒ ์›์†Œ๋กœ ๋ฐœ๊ฒฌ๋˜์–ด์„œ ๋ถˆํ•„์š”ํ•œ ํƒ์ƒ‰์ด ๋  ์ˆ˜๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! for๋ฌธ์—์„œ ์ž๊ธฐ ์ž์‹ ์„ ์ œ๊ฑฐํ•˜๋Š” ๋กœ์ง์„ ๋จผ์ € ์ถ”๊ฐ€ํ•˜๊ณ  ์‹œ์ž‘ํ•˜๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”?

์ €๋Š” ์ด ๋ฌธ์ œ๋ฅผ c-1 ์ด ์—†์„ ๋•Œ ํ•ด๋‹น ์›์†Œ๋ฅผ ์—ฐ์†๋œ ์ˆซ์ž์˜ ์‹œ์ž‘์ด๋ผ๊ณ  ๋ณด๊ณ , ๊ฑฐ๊ธฐ์„œ๋ถ€ํ„ฐ +1 ํ•˜๋ฉด์„œ longest ๋ฅผ ์„ธ๋Š” ๋ฐฉ์‹์œผ๋กœ ํ’€์—ˆ๋Š”๋ฐ set์„ ์ œ๊ฑฐ ์•ˆํ•˜๊ณ  ํ’€ ์ˆ˜ ์žˆ์–ด์„œ ์ข€ ๋” ๊น”๋”ํ•ด์งˆ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

์ œ์‹œํ•ด์ฃผ์‹  ๋ฐฉ๋ฒ•์ด ๋” ๋‚˜์„๊ฒƒ ๊ฐ™๋„ค์š” ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

@yerim01 yerim01 merged commit b6d6593 into DaleStudy:main Mar 7, 2026
1 check passed
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