Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DaleSeo] WEEK 10 solutions#2284

Merged
DaleSeo merged 1 commit intoDaleStudy:mainDaleStudy/leetcode-study:mainfrom
DaleSeo:mainDaleSeo/leetcode-study:mainCopy head branch name to clipboard
Jan 20, 2026
Merged

[DaleSeo] WEEK 10 solutions#2284
DaleSeo merged 1 commit intoDaleStudy:mainDaleStudy/leetcode-study:mainfrom
DaleSeo:mainDaleSeo/leetcode-study:mainCopy head branch name to clipboard

Conversation

@DaleSeo
Copy link
Member

@DaleSeo DaleSeo commented Jan 18, 2026

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

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

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

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

Important

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

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

@DaleSeo
Copy link
Member Author

DaleSeo commented Jan 20, 2026

@DaleStudy ๋ฆฌ๋ทฐ

@dalestudy
Copy link
Contributor

dalestudy bot commented Jan 20, 2026

์ข‹์€ ์‹œ๋„์™€ ๊น”๋”ํ•œ ๊ตฌํ˜„์ž…๋‹ˆ๋‹ค! ํŠนํžˆ, Rust์˜ Rc์™€ RefCell์„ ์ ์ ˆํžˆ ํ™œ์šฉํ•˜์—ฌ ํŠธ๋ฆฌ ๋…ธ๋“œ๋ฅผ ๋ฌด์‚ฌํžˆ ๋‹ค๋ฃจ๋Š” ์ ์ด ์ธ์ƒ์ ์ž…๋‹ˆ๋‹ค. ์‹œ๊ฐ„ ๋ณต์žก๋„ O(n)๊ณผ ๊ณต๊ฐ„ ๋ณต์žก๋„ O(n)๋„ ์ ์ ˆํžˆ ๋ช…์‹œํ•˜์…จ๊ณ , ์žฌ๊ท€์  ์ ‘๊ทผ ๋ฐฉ๋ฒ•๋„ ํšจ์œจ์ ์ž…๋‹ˆ๋‹ค.

๋ช‡ ๊ฐ€์ง€ ํ”ผ๋“œ๋ฐฑ์„ ๋“œ๋ฆฌ์ž๋ฉด:

  1. as_ref()๋ฅผ ์‚ฌ์šฉํ•ด Option์„ ๊น”๋”ํ•˜๊ฒŒ ์ฒ˜๋ฆฌํ•˜์…จ๋Š”๋ฐ, if let Some(node) = root๋กœ ๊ฐ„๋‹จํžˆ ํ‘œํ˜„ํ•˜๋Š” ๊ฒƒ๋„ ๊ฐ€๋…์„ฑ์— ๋„์›€๋ฉ๋‹ˆ๋‹ค.
  2. ํ•จ์ˆ˜ ๋‚ด์—์„œ clone()์„ ์ž์ฃผ ํ˜ธ์ถœํ•˜๋Š”๋ฐ, ์ด๋Š” Rc์˜ ์ฐธ์กฐ ์นด์šดํŠธ ์ฆ๊ฐ€๋กœ ๋น„์šฉ์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ด ๋ฌธ์ œ๋Š” ํŠธ๋ฆฌ ๊ตฌ์กฐ์˜ ํŠน์„ฑ์ƒ ํ”ผํ•  ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์•„ ํฌ๊ฒŒ ๋ฌธ์ œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  3. ๊ฐ€๋…์„ฑ์„ ์œ„ํ•ด, invert_tree ์žฌ๊ท€ ํ˜ธ์ถœ ์ „ํ›„์— ์ž ์‹œ ๋ณ€์ˆ˜์— ์ €์žฅํ•˜๋Š” ๊ฒƒ๋ณด๋‹ค ์ธ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•˜์…จ๋Š”๋ฐ, ์ด๋Š” ๋ช…ํ™•์„ฑ์„ ํ•ด์น˜์ง€ ์•Š์œผ๋ฉด์„œ๋„ ๊น”๋”ํ•ฉ๋‹ˆ๋‹ค.

ํ˜น์‹œ ๋” ๋‚˜์€ ์ ‘๊ทผ๋ฒ•์„ ์›ํ•˜์‹ ๋‹ค๋ฉด, ๋ฐ˜๋ณต์ (๋น„์žฌ๊ท€์ ) ๋ฐฉ๋ฒ•์„ ๊ณ ๋ คํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํ˜„์žฌ ๊ตฌํ˜„์€ ๋งค์šฐ ์ ์ ˆํ•˜๋ฉฐ, Rust์˜ ํŠน์„ฑ์„ ์ž˜ ์‚ด๋ ธ์Šต๋‹ˆ๋‹ค.

์ˆ˜๊ณ ํ•˜์…จ๊ณ , ์•ž์œผ๋กœ๋„ ์ข‹์€ ์ฝ”๋“œ ๊ธฐ๋Œ€ํ•ฉ๋‹ˆ๋‹ค!

@DaleSeo
Copy link
Member Author

DaleSeo commented Jan 20, 2026

@DaleStudy ์Šน์ธ

Copy link
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.

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

@DaleSeo DaleSeo merged commit f81fb26 into DaleStudy:main Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.