Skip to content

[jjipper] WEEK 01 solutions#2395

Merged
jjipper merged 3 commits intoDaleStudy:mainfrom
jjipper:WEEK01
Mar 8, 2026
Merged

[jjipper] WEEK 01 solutions#2395
jjipper merged 3 commits intoDaleStudy:mainfrom
jjipper:WEEK01

Conversation

@jjipper
Copy link
Copy Markdown
Contributor

@jjipper jjipper commented Mar 8, 2026

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

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

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

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

Important

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

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

@jjipper
Copy link
Copy Markdown
Contributor Author

jjipper commented Mar 8, 2026

@DaleStudy ๋ฆฌ๋ทฐํ•ด์ค˜

@dalestudy
Copy link
Copy Markdown
Contributor

dalestudy bot commented Mar 8, 2026

์ „์ฒด์ ์œผ๋กœ ๊น”๋”ํ•˜๊ณ  ํšจ์œจ์ ์ธ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค! ์‹œ๊ฐ„๊ณผ ๊ณต๊ฐ„ ๋ณต์žก๋„๋„ ์ž˜ ํ‘œ๊ธฐ๋˜์–ด ์žˆ์œผ๋ฉฐ, ๋‘ ๋ฌธ์ œ ๋ชจ๋‘ ์ตœ์ ์˜ ํ•ด๋ฒ•์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด ์ข‹์€ ์ ‘๊ทผ์ž…๋‹ˆ๋‹ค. ๋ช‡ ๊ฐ€์ง€ ์ œ์•ˆ๋“œ๋ฆฌ์ž๋ฉด:

  1. ๊ฐ€๋…์„ฑ ํ–ฅ์ƒ: ํ•จ์ˆ˜์— ๊ฐ„๋‹จํ•œ ์„ค๋ช… ๋˜๋Š” ์ธ๋ผ์ธ ์ฝ”๋ฉ˜ํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ์ฝ๋Š” ์‚ฌ๋žŒ์ด ๋” ์ดํ•ดํ•˜๊ธฐ ์‰ฌ์›Œ์ง‘๋‹ˆ๋‹ค. ํŠนํžˆ, ๋‘ ๋ฒˆ์งธ ๋ฌธ์ œ์˜ ๊ฒฝ์šฐ "Hash Map์„ ์ด์šฉํ•œ Two Sum"๊ณผ ๊ฐ™์€ ๊ฐ„๋‹จํ•œ ์„ค๋ช…์„ ๋„ฃ์–ด๋„ ์ข‹์Šต๋‹ˆ๋‹ค.

  2. ์ฝ”๋“œ ์Šคํƒ€์ผ: ํƒ€์ž… ์„ ์–ธ์„ ๋ช…ํ™•ํžˆ ํ•˜๋Š” ์ ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์ผ๊ด€๋œ ํฌ๋งท ์œ ์ง€๋„ ์ข‹์•„์š”.

  3. ์ถ”๊ฐ€ ์ œ์•ˆ: ๋‘ ๋ฌธ์ œ ๋ชจ๋‘ ์‹œ๊ฐ„ ๋ณต์žก๋„ O(n), ๊ณต๊ฐ„ ๋ณต์žก๋„ O(n)์œผ๋กœ ์ตœ์ ํ™”๋์œผ๋ฉฐ, ์ด๋ณด๋‹ค ๋” ์ข‹์€ ๋ฐฉ๋ฒ•์€ ์—†์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ, ์ž‘์€ ์ตœ์ ํ™”๋กœ๋Š” containsDuplicate์—์„œ๋Š” Set์„ ์‚ฌ์šฉํ•  ๋•Œ has ํ˜ธ์ถœ์„ ๋ฐ”๋กœ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ตฌ์กฐ๋ฅผ ์œ ์ง€ํ•˜๋Š” ๊ฒƒ๋„ ์ข‹๊ณ , twoSum์€ Map ๋Œ€์‹  Object๋ฅผ ์‚ฌ์šฉํ–ˆ๋Š”๋ฐ, ์ด ๋ถ€๋ถ„๋„ ์ถฉ๋ถ„ํžˆ ํ‘œ์ค€์ ์ž…๋‹ˆ๋‹ค.

์ „๋ฐ˜์ ์œผ๋กœ ์ž˜ ์ž‘์„ฑ๋œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค! ์•ž์œผ๋กœ๋„ ์ด๋Ÿฐ ๊น”๋”ํ•œ ์†”๋ฃจ์…˜ ๊ธฐ๋Œ€ํ• ๊ฒŒ์š”. ๊ณ„์†ํ•ด์„œ ๊ฐœ์„ ํ•˜๋Š” ์Šต๊ด€์ด ๋ฉ‹์ง‘๋‹ˆ๋‹ค!

@DaleStudy DaleStudy deleted a comment from dalestudy bot Mar 8, 2026
@jjipper
Copy link
Copy Markdown
Contributor Author

jjipper commented Mar 8, 2026

@DaleStudy ์Šน์ธ

Copy link
Copy Markdown
Contributor

@dalestudy dalestudy bot left a comment

Choose a reason for hiding this comment

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

์Šน์ธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค! ๐Ÿ‘

@jjipper jjipper merged commit b12f412 into DaleStudy:main Mar 8, 2026
1 check passed
Copy link
Copy Markdown
Contributor

@dohyeon2 dohyeon2 left a comment

Choose a reason for hiding this comment

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

์ „๋ฐ˜์ ์œผ๋กœ ๊น”๋”ํ•œ ํ’€์ด์ž…๋‹ˆ๋‹ค!

if (seen.has(num)) {
return true;
}
seen.add(num);
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.

์ด ๋ฐฉ์‹์ด๋ผ๋ฉด Set์— ๋ชจ๋“  ์ˆซ์ž๋ฅผ ๋„ฃ์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๋„ ์ƒ๊ฒจ์„œ
๋ชจ๋‘ ๋„ฃ๊ณ  ์‚ฌ์ด์ฆˆ๋ฅผ ๋น„๊ตํ•˜๋Š” ๋ฐฉ์‹๋ณด๋‹ค ํšจ์œจ์ ์ผ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
์˜๋ฏธ๋„ ๋ช…ํ™•ํ•ด์„œ ์ข‹์€ ํ’€์ด์ธ ๊ฒƒ ๊ฐ™๋„ค์š”!

for (let i = 0; i < nums.length; i++) {
const a = nums[i];
const b = target - a;
if (b in obj) {
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 Author

Choose a reason for hiding this comment

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

์•— ๊ทธ๋Ÿฌ๋„ค์š” ๋ณ€์ˆ˜๋ช…๋„ ์˜๋ฏธ์žˆ๊ฒŒ ์ž‘์„ฑํ•˜๋„๋ก ์‹ ๊ฒฝ์จ์•ผ๊ฒ ์Šต๋‹ˆ๋‹ค.
์ข‹์€ ํ”ผ๋“œ๋ฐฑ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค ๋„ํ˜„๋‹˜! ๐Ÿ˜€

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