Skip to content

[chapse57] Week 3#2722

Open
chapse57 wants to merge 8 commits into
DaleStudy:mainfrom
chapse57:main
Open

[chapse57] Week 3#2722
chapse57 wants to merge 8 commits into
DaleStudy:mainfrom
chapse57:main

Conversation

@chapse57

@chapse57 chapse57 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

โ€ป ์ด์ „ ์ฃผ์ฐจ(Week 1ยท2) ์ปค๋ฐ‹์ด ๋ณธ์ง„ ๋ฏธ๋จธ์ง€ ์ƒํƒœ๋ผ ํ•จ๊ป˜ ๋”ธ๋ ค์™”์Šต๋‹ˆ๋‹ค. ์ด๋ฒˆ ์ฃผ ์ œ์ถœ์€ Climbing Stairs, Number of 1 Bits์ž…๋‹ˆ๋‹ค.

  • Climbing Stairs
  • Number of 1 Bits

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

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

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

Important

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

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

@dalestudy

dalestudy Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

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

๋ฌธ์ œ ๋‚œ์ด๋„ ์œ ํ˜• ๋ถ„์„
climbing-stairs Easy โœ… ์˜๋„ํ•œ ์œ ํ˜•
contains-duplicate Easy โš ๏ธ ์œ ํ˜• ๋ถˆ์ผ์น˜
group-anagrams Medium โœ… ์˜๋„ํ•œ ์œ ํ˜•
number-of-1-bits Easy โœ… ์˜๋„ํ•œ ์œ ํ˜•
top-k-frequent-elements Medium โš ๏ธ ์œ ํ˜• ๋ถˆ์ผ์น˜
two-sum Easy โœ… ์˜๋„ํ•œ ์œ ํ˜•
valid-anagram Easy โš ๏ธ ์œ ํ˜• ๋ถˆ์ผ์น˜

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

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

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

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

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

๐Ÿ”ข API ์‚ฌ์šฉ๋Ÿ‰ (gpt-5-nano)
์š”์ฒญ ์ž…๋ ฅ ํ† ํฐ ์ถœ๋ ฅ ํ† ํฐ ํ•ฉ๊ณ„ ๋น„์šฉ
1 1,812 248 2,060 $0.000190
2 2,067 347 2,414 $0.000242
ํ•ฉ๊ณ„ 3,879 595 4,474 $0.000432

@freemjstudio freemjstudio left a comment

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.

์—‡ 3์ฃผ์ฐจ ๋ฌธ์ œ๋ž‘ ์˜ˆ์ „ ๋ฌธ์ œ๋ž‘ ์„ž์ธ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค..!
์ฝ”๋“œ๊ฐ€ ์ „๋ฐ˜์ ์œผ๋กœ ํŒŒ์ด์ฌ ํ•จ์ˆ˜๋“ค์„ ์ž˜ ํ™œ์šฉํ•˜์…”์„œ ๊ฐ„๊ฒฐํ•˜๋„ค์šฉ!

์ œ๊ฐ€ ์ง€๋‚œ ์ฃผ์ฐจ ๋ฌธ์ œ๋„ mergeํ•ด๋„ ๋˜๋Š”์ง€ study ๊ทœ์น™์„ ๋ชฐ๋ผ์„œ ์ฝ”๋ฉ˜ํŠธ๋งŒ ๋‚จ๊ธฐ๊ฒ ์Šต๋‹ˆ๋‹ค,,, ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค !

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.

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

  • ํŒจํ„ด: Dynamic Programming, Greedy
  • ์„ค๋ช…: ํด๋ž˜์‹ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด ๊ธฐ๋ฐ˜์˜ DP ํ˜•ํƒœ๋กœ, ์ด์ „ ๋‘ ๊ฐ’์„ ์ด์šฉํ•ด ํ˜„์žฌ ๊ฐ’์„ ๊ณ„์‚ฐํ•˜๋ฉฐ ์ตœ์ ํ•ด๋ฅผ ๊ตฌํ•œ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ์ž…๋ ฅ n์— ๋Œ€ํ•ด ์ƒ์ˆ˜ ๊ณต๊ฐ„์œผ๋กœ ๋งˆ์ง€๋ง‰ ๋‘ ๊ฐ’์„ ์œ ์ง€ํ•˜๋ฉฐ ๋ฐ˜๋ณต์œผ๋กœ ๊ฒฐ๊ณผ๋ฅผ ๊ตฌํ•œ๋‹ค.

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

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

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.

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

  • ํŒจํ„ด: Brute Force
  • ์„ค๋ช…: ๋‘ ์›์†Œ๋ฅผ ์ด์ค‘ ์ˆœํšŒํ•˜์—ฌ ๋™์ผํ•œ ๊ฐ’์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ, ๊ฐ€์žฅ ๋‹จ์ˆœํ•œ ํƒ์ƒ‰ ํŒจํ„ด์ธ Brute Force์— ํ•ด๋‹นํ•ฉ๋‹ˆ๋‹ค. ์‹œ๊ฐ„ ๋ณต์žก๋„ O(n^2)์œผ๋กœ ๋น„ํšจ์œจ์ ์ด์ง€๋งŒ ๊ตฌํ˜„์ด ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ์ค‘์ฒฉ ๋ฃจํ”„๋ฅผ ํ†ตํ•ด ๋ชจ๋“  ์Œ์„ ๋น„๊ตํ•˜๋ฏ€๋กœ ์‹œ๊ฐ„ ๋ณต์žก๋„๊ฐ€ n^2์ด๋‹ค.

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

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

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, Sorting
  • ์„ค๋ช…: ๋ฌธ์ž์—ด์„ ์ •๋ ฌํ•œ ํ‚ค๋ฅผ ํ•ด์‹œ ๋งต์— ๋งคํ•‘ํ•ด ๊ฐ™์€ ์•„๋‚˜๊ทธ๋žจ์„ ๋ฌถ๋Š” ๋ฐฉ์‹์œผ๋กœ ์ค‘๋ณต ์—ฌ๋ถ€๋ฅผ ํ•ด์‹œ ๋งต์œผ๋กœ ๊ด€๋ฆฌํ•œ๋‹ค. ์ •๋ ฌ์€ ๋ณ€ํ™˜ ํ‚ค ์ƒ์„ฑ, ํ•ด์‹œ ๋งต์€ ๊ทธ๋ฃน์œผ๋กœ ๋ฌถ๋Š” ์—ญํ• ์„ ํ•œ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ๊ฐ ๋‹จ์–ด๋ณ„๋กœ ์ •๋ ฌ cost๊ฐ€ ์กด์žฌํ•˜๊ณ  ํ•ด์‹œ๋งต์— ๊ทธ๋ฃน์„ ์ €์žฅํ•œ๋‹ค.

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

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

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.

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

  • ํŒจํ„ด: Bit Manipulation
  • ์„ค๋ช…: ์ฝ”๋“œ๋Š” ์ฃผ์–ด์ง„ ์ •์ˆ˜๋ฅผ ์ด์ง„ ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜ํ•œ ํ›„ '1'์˜ ๊ฐœ์ˆ˜๋ฅผ ์…ˆ. ๋น„ํŠธ ์กฐ์ž‘๋ณด๋‹จ ๋‚ด์žฅ ํ•จ์ˆ˜ ํ™œ์šฉ์ด์ง€๋งŒ ๋น„ํŠธ์˜ 1๋น„ํŠธ๋ฅผ ์„ธ๋Š” ํŒจํ„ด๊ณผ ๊ด€๋ จ๋œ Bit Manipulation ๊ณ„์—ด์— ๊ฐ€๊น์Šต๋‹ˆ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ๋ฌธ์ž์—ด ๋ณ€ํ™˜๊ณผ ์นด์šดํŠธ ๋ฐฉ์‹์œผ๋กœ ์ƒ์ˆ˜ ๊ณต๊ฐ„์—์„œ ๋™์ž‘ํ•œ๋‹ค.

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

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

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, Sorting
  • ์„ค๋ช…: ์ž…๋ ฅ ์ˆ˜๋ฅผ ํ•ด์‹œ ๋งต์œผ๋กœ ์„ธ๊ณ , ๊ฐ ์›์†Œ์˜ ๋นˆ๋„์ˆ˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌํ•˜์—ฌ ์ƒ์œ„ k๊ฐœ๋ฅผ ๋ฝ‘๋Š” ๋ฐฉ์‹์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด์‹œ ๋งต์„ ์‚ฌ์šฉํ•œ ์นด์šดํŠธ์™€ ๋นˆ๋„ ๊ธฐ๋ฐ˜ ์ •๋ ฌ์ด ํ•ต์‹ฌ ํŒจํ„ด์ž…๋‹ˆ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ๋นˆ๋„ ์ˆ˜๋ฅผ ๋‚ด๋ฆผ์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌํ•˜๋Š” ๋น„์šฉ์ด ์ฃผ๋œ ์‹œ๊ฐ„ ๋ณต์žก๋„๋‹ค.

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

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

Comment thread two-sum/chapse57.py

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, Two Pointers
  • ์„ค๋ช…: ํ•ด๋‹น ์ฝ”๋“œ๋Š” ํ•ด์‹œ ๋งต์œผ๋กœ ๊ฐ’์„ ์ €์žฅํ•˜๊ณ , ํƒ€๊นƒ-ํ˜„์žฌ๊ฐ’์˜ ์กด์žฌ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜์—ฌ ํ•œ ๋ฒˆ์˜ ์ˆœํšŒ๋กœ ๋‹ต์„ ์ฐพ๋Š” ๋ฐฉ์‹์ด๋‹ค. ๋‘ ํฌ์ธํ„ฐ๊ฐ€ ์•„๋‹ˆ๋ผ ํ•ด์‹œ ๋งต ๊ธฐ๋ฐ˜์˜ ํƒ์ƒ‰์œผ๋กœ ํŠน์ • ํŒจํ„ด์„ ์ ์šฉํ•œ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ์ตœ์ ์˜ ์„ ํ˜• ์‹œ๊ฐ„ ์†”๋ฃจ์…˜์œผ๋กœ ์ผ๋ฐ˜์ ์ธ ์ ‘๊ทผ์ด๋‹ค.

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

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

Comment thread valid-anagram/chapse57.py

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.

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

  • ํŒจํ„ด: Sorting
  • ์„ค๋ช…: ๋‘ ๋ฌธ์ž์—ด์„ ์ •๋ ฌํ•œ ๋’ค ๋น„๊ตํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋™์ผ ์—ฌ๋ถ€๋ฅผ ํŒ๋‹จํ•˜๋ฏ€๋กœ ์ •๋ ฌ ๊ธฐ๋ฐ˜ ๋น„๊ต ํŒจํ„ด์— ์†ํ•ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ์ž…๋ ฅ ํฌ๊ธฐ์— ๋”ฐ๋ผ ์‹œ๊ฐ„ ๋ณต์žก๋„ O(n log n)๊ฐ€ ํŠน์ง•์ž…๋‹ˆ๋‹ค.

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

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

ํ”ผ๋“œ๋ฐฑ: ์ •๋ ฌ ๋น„์šฉ์ด ์ฃผ๋œ ์‹œ๊ฐ„ ๋ณต์žก๋„์ด๋ฉฐ ์ถ”๊ฐ€ ๊ณต๊ฐ„์€ ์ •๋ ฌ ๋ฐฉ์‹์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง„๋‹ค.

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

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

@togo26 togo26 self-requested a review July 11, 2026 16:15

@togo26 togo26 left a comment

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.

PR์— ์–ธ๊ธ‰ํ•˜์‹  ๋ฌธ์ œ ์œ„์ฃผ๋กœ ๊ฒ€ํ† ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์ตœ์ ํ™” ๊ฒ€ํ†  ๊ด€์ ์—์„œ ๋ณต์žก๋„ ๊ณ„์‚ฐ๋„ ์ถ”๊ฐ€ํ•ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. 3์ฃผ์ฐจ ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค๐Ÿ‘

Comment on lines +17 to +19
c = a + b
a = b
b = c

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.

๊ณต๊ฐ„๋ณต์žก๋„ ๊ณ ๋ คํ•œ ์ ์€ ์ข‹์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ ๋ณ€์ˆ˜๋ช…์„ ์ข€ ๋” ๊ตฌ์ฒด์ ์œผ๋กœ ์ž‘์„ฑํ•ด์ฃผ์‹œ๋ฉด ๋ฆฌ๋ทฐ์–ด ์ž…์žฅ์—์„œ ๊ฒ€ํ† ํ•˜๊ธฐ ์ข‹์œผ๋‹ˆ ๊ณ ๋ คํ•ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

:type n: int
:rtype: int
"""
return bin(n).count("1")

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.

์‹ฌํ”Œํ•˜๊ฒŒ ํ’€์–ด์ฃผ์…”์„œ ์ข‹๋„ค์š”. ๋‚ด์žฅ ํ•จ์ˆ˜ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ• ์™ธ์—๋„ ์ด์ง„๋ฒ• ๊ณ„์‚ฐ ๋ฐฉ์‹์ด๋‚˜ ๋น„ํŠธ ์—ฐ์‚ฐ ๋ฐฉ์‹ ๋“ฑ ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ๋ฌธ์ œ์— ์ ‘๊ทผํ•˜์‹œ๋Š” ๊ฒƒ๋„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค.

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.

3 participants